<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <link rel="dns-prefetch" href="maode.github.io">
  <title>【转】BAT批处理脚本教程 | Code0&#39;s notepad</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="转自： http://xiangkg.blog.163.com/blog 前言 第一章 批处理基础批处理定义：顾名思义，批处理文件是将一系列命令按一定的顺序集合为一个可执行的文本文件，其扩展名为BAT或者CMD。这些命令统称批处理命令。 小知识：可以在键盘上按下Ctrl+C组合键来强行终止一个批处理的执行过程。 了解了大概意思后,我们正式开始学习.先看一个简单的例子!123@echo offech">
<meta name="keywords" content="BAT,批处理,CMD">
<meta property="og:type" content="article">
<meta property="og:title" content="【转】BAT批处理脚本教程">
<meta property="og:url" content="maode.github.io/2018/02/18/180218-BAT-tutorial/index.html">
<meta property="og:site_name" content="Code0&#39;s notepad">
<meta property="og:description" content="转自： http://xiangkg.blog.163.com/blog 前言 第一章 批处理基础批处理定义：顾名思义，批处理文件是将一系列命令按一定的顺序集合为一个可执行的文本文件，其扩展名为BAT或者CMD。这些命令统称批处理命令。 小知识：可以在键盘上按下Ctrl+C组合键来强行终止一个批处理的执行过程。 了解了大概意思后,我们正式开始学习.先看一个简单的例子!123@echo offech">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-02-22T04:07:34.073Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="【转】BAT批处理脚本教程">
<meta name="twitter:description" content="转自： http://xiangkg.blog.163.com/blog 前言 第一章 批处理基础批处理定义：顾名思义，批处理文件是将一系列命令按一定的顺序集合为一个可执行的文本文件，其扩展名为BAT或者CMD。这些命令统称批处理命令。 小知识：可以在键盘上按下Ctrl+C组合键来强行终止一个批处理的执行过程。 了解了大概意思后,我们正式开始学习.先看一个简单的例子!123@echo offech">
  
    <link rel="alternative" href="/atom.xml" title="Code0&#39;s notepad" type="application/atom+xml">
  
  
    <link rel="icon" href="/assets/img/favicon.ico">
  
  <link rel="stylesheet" type="text/css" href="/./main.266c1c.css">
  <style type="text/css">
  
    #container.show {
      background: linear-gradient(200deg,#a0cfe4,#e8c37e);
    }
  </style>
  

  

</head>
</html>
<body>
  <div id="container" q-class="show:isCtnShow">
    <canvas id="anm-canvas" class="anm-canvas"></canvas>
    <div class="left-col" q-class="show:isShow">
      
<div class="overlay" style="background: #4d4d4d"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			<img src="/assets/img/plan.jpg" class="js-avatar">
		</a>
		<hgroup>
		  <h1 class="header-author"><a href="/">Code0</a></h1>
		</hgroup>
		
		<p class="header-subtitle">纯洁的记事本</p>
		

		<nav class="header-menu">
			<ul>
			
				<li><a href="/">主页</a></li>
	        
			</ul>
		</nav>
		<nav class="header-smart-menu">
    		
    			
    			<a q-on="click: openSlider(e, 'innerArchive')" href="javascript:void(0)">所有文章</a>
    			
            
    			
            
    			
    			<a q-on="click: openSlider(e, 'aboutme')" href="javascript:void(0)">关于本站</a>
    			
            
		</nav>
		<nav class="header-nav">
			<div class="social">
				
					<a class="github" target="_blank" href="https://github.com/maode" title="github"><i class="icon-github"></i></a>
		        
					<a class="rss" target="_blank" href="/atom.xml" title="rss"><i class="icon-rss"></i></a>
		        
			</div>
		</nav>
	</header>		
</div>

    </div>
    <div class="mid-col" q-class="show:isShow,hide:isShow|isFalse">
      
<nav id="mobile-nav">
  	<div class="overlay js-overlay" style="background: #4d4d4d"></div>
	<div class="btnctn js-mobile-btnctn">
  		<div class="slider-trigger list" q-on="click: openSlider(e)"><i class="icon icon-sort"></i></div>
	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
				<img src="/assets/img/plan.jpg" class="js-avatar">
			</div>
			<hgroup>
			  <h1 class="header-author js-header-author">Code0</h1>
			</hgroup>
			
			<p class="header-subtitle"><i class="icon icon-quo-left"></i>纯洁的记事本<i class="icon icon-quo-right"></i></p>
			
			
			
				
			
			
			
			<nav class="header-nav">
				<div class="social">
					
						<a class="github" target="_blank" href="https://github.com/maode" title="github"><i class="icon-github"></i></a>
			        
						<a class="rss" target="_blank" href="/atom.xml" title="rss"><i class="icon-rss"></i></a>
			        
				</div>
			</nav>

			<nav class="header-menu js-header-menu">
				<ul style="width: 50%">
				
				
					<li style="width: 100%"><a href="/">主页</a></li>
		        
				</ul>
			</nav>
		</header>				
	</div>
	<div class="mobile-mask" style="display:none" q-show="isShow"></div>
</nav>

      <div id="wrapper" class="body-wrap">
        <div class="menu-l">
          <div class="canvas-wrap">
            <canvas data-colors="#eaeaea" data-sectionHeight="100" data-contentId="js-content" id="myCanvas1" class="anm-canvas"></canvas>
          </div>
          <div id="js-content" class="content-ll">
            <article id="post-180218-BAT-tutorial" class="article article-type-post " itemscope itemprop="blogPost">
  <div class="article-inner">
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      【转】BAT批处理脚本教程
    </h1>
  

        
        <a href="/2018/02/18/180218-BAT-tutorial/" class="archive-article-date">
  	<time datetime="2018-02-18T10:36:47.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-02-18</time>
</a>
        
      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><strong>转自：</strong> <a href="http://xiangkg.blog.163.com/blog" target="_blank" rel="noopener">http://xiangkg.blog.163.com/blog</a></p>
<p><a href="#前言">前言</a></p>
<h2 id="第一章-批处理基础"><a href="#第一章-批处理基础" class="headerlink" title="第一章 批处理基础"></a>第一章 批处理基础</h2><p>批处理定义：顾名思义，批处理文件是将一系列命令按一定的顺序集合为一个可执行的文本文件，其扩展名为BAT或者CMD。这些命令统称批处理命令。</p>
<p>小知识：可以在键盘上按下Ctrl+C组合键来强行终止一个批处理的执行过程。</p>
<p>了解了大概意思后,我们正式开始学习.先看一个简单的例子!<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> "欢迎来到非常BAT!"</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>把上面的3条命令保存为文件test.bat或者test.cmd然后执行,<br>他就会在屏幕上显示以下二行话<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">欢迎来到非常BAT!</span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<p>这就是一个简单批处理文件了，这个批处理文件一共就用了2条命令 “echo” 和”pause” 还有一个特殊符号”@”</p>
<p>从上面这个简单的批处理中,我们可以发现其实批处理就是运用一些含有特殊意义的符号和一些完成指定功能的命令组合而成,那么在批处理中有多少这样的特殊符号和功能命令呢？我们现在就来仔细了解一下一些最常用的!</p>
<p>(以下内容来源网络,请各位仔细阅读,好进入下节的实例说明)</p>
<a id="more"></a>
<h3 id="第一节-常用批处理内部命令简介"><a href="#第一节-常用批处理内部命令简介" class="headerlink" title="第一节 常用批处理内部命令简介"></a>第一节 常用批处理内部命令简介</h3><h4 id="REM-和"><a href="#REM-和" class="headerlink" title="REM 和 ::"></a>REM 和 <code>::</code></h4><p>REM为注释命令，一般用来给程序加上注解，该命令后的内容不被执行，但能回显。</p>
<p><code>::</code> 也可以起注释作用, 而且更简洁有效; 但有两点需要注意：</p>
<ol>
<li>任何以冒号<code>:</code>开头的字符行, 在批处理中都被视作标号, 而直接忽略其后的所有内容。而标号分为有效和无效两种。<br>有效标号：冒号后紧跟一个以字母数字开头的字符串，goto语句可以识别。<br>无效标号：冒号后紧跟一个非字母数字的一个特殊符号，goto无法识别的标号。</li>
</ol>
<p>无效可以起到注释作用，所以 <code>::</code> 常被用作注释符号，其实 <code>:+</code> 也可起注释作用。</p>
<ol start="2">
<li>与<code>rem</code>不同的是, <code>::</code>后的字符行在执行时不会回显, 无论是否用echo on打开命令行回显状态, 因为命令解释器不认为他是一个有效的命令行, 就此点来看, rem 在某些场合下将比 <code>::</code> 更为适用; 另外, rem 可以用于 config.sys 文件中。</li>
</ol>
<p>行内注释格式：%注释内容%  （不常用，容易引起语法错误，慎用少用）</p>
<h4 id="ECHO-和"><a href="#ECHO-和" class="headerlink" title="ECHO 和 @"></a>ECHO 和 @</h4><p>@字符放在命令前将关闭该命令回显，无论此时echo是否为打开状态。</p>
<p>echo命令的作用列举如下：</p>
<p>（1）打开回显或关闭回显功能</p>
<p> 格式：echo [{ on|off }]<br>如果想关闭“ECHO OFF”命令行自身的显示，则需要在该命令行前加上“@”。</p>
<p>（2）显示当前ECHO设置状态<br> 格式：echo</p>
<p>（3）输出提示信息</p>
<pre><code>格式：ECHO 信息内容
</code></pre><p>上述是ECHO命令常见的三种用法，也是大家熟悉和会用的，但作为DOS命令淘金者你还应该知道下面的技巧：</p>
<p>（4）关闭DOS命令提示符<br>在DOS提示符状态下键入ECHO OFF，能够关闭DOS提示符的显示使屏幕只留下光标，直至键入ECHO ON，提示符才会重新出现。</p>
<p>（5）输出空行，即相当于输入一个回车</p>
<pre><code>格式：ECHO．
</code></pre><p>值得注意的是命令行中的“．”要紧跟在ECHO后面中间不能有空格，否则“．”将被当作提示信息输出到屏幕。另外“．”可以用 <code>,:;&quot;/[\]+</code> 等任一符号替代。</p>
<p>命令ECHO．输出的回车，经DOS管道转向可以作为其它命令的输入，比如echo.|time即相当于在TIME命令执行后给出一个回车。所以执行时系统会在显示当前时间后，自动返回到DOS提示符状态</p>
<p>（6）答复命令中的提问</p>
<pre><code>格式：ECHO 答复语|命令文件名
</code></pre><p>上述格式可以用于简化一些需要人机对话的命令（如：<code>CHKDSK／F；FORMAT Drive:；del *.*</code>）的操作，它是通过DOS管道命令把ECHO命令输出的预置答复语作为人机对话命令的输入。下面的例子就相当于在调用的命令出现人机对话时输入“Y”回车：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">C:&gt;<span class="title">ECHO</span> <span class="title">Y</span>|<span class="title">CHKDSK</span>/<span class="title">F</span></span></span><br><span class="line"><span class="function"><span class="title">C</span>:&gt;<span class="title">ECHO</span> <span class="title">Y</span>|<span class="title">DEL</span> <span class="title">A</span> :*.*</span></span><br></pre></td></tr></table></figure></p>
<p>（7）建立新文件或增加文件内容</p>
<p>格式：ECHO 文件内容&gt;文件名<br>      ECHO 文件内容&gt;&gt;文件名</p>
<p>例如：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">C:&gt;<span class="title">ECHO</span> @<span class="title">ECHO</span> <span class="title">OFF</span>&gt;<span class="title">AUTOEXEC.BAT</span> 建立自动批处理文件</span></span><br><span class="line"><span class="function"><span class="title">C</span>:&gt;<span class="title">ECHO</span> <span class="title">C</span>:\<span class="title">CPAV</span>\<span class="title">BOOTSAFE</span>&gt;&gt;<span class="title">AUTOEXEC.BAT</span> 向自动批处理文件中追加内容</span></span><br></pre></td></tr></table></figure></p>
<p>（8）向打印机输出打印内容或打印控制码</p>
<p>格式：ECHO 打印机控制码&gt;PRN</p>
<pre><code>ECHO 打印内容&gt;PRN
</code></pre><p>用得很少，了解就可以了</p>
<p>下面的例子是向M－1724打印机输入打印控制码。＜Alt＞156是按住Alt键在小键盘键入156，类似情况依此类推：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">C:&gt;<span class="title">ECHO</span> +156+42+116&gt;<span class="title">PRN</span>（输入下划线命令<span class="title">FS</span>＊<span class="title">t</span>）</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function"><span class="title">C</span>:&gt;<span class="title">ECHO</span> [<span class="title">PRN</span>"&gt;+155@&gt;<span class="title">PRN</span>](<span class="title">mailto</span>:+155@)（输入初始化命令<span class="title">ESC</span>@）</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function"><span class="title">C</span>:&gt;<span class="title">ECHO</span>.&gt;<span class="title">PRN</span>（换行）</span></span><br></pre></td></tr></table></figure></p>
<p>（9）使喇叭鸣响<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">C:&gt;<span class="title">ECHO</span> ^<span class="title">G</span></span></span><br></pre></td></tr></table></figure></p>
<p>“^G”是在dos窗口中用Ctrl＋G或Alt＋007输入，输入多个^G可以产生多声鸣响。使用方法是直接将其加入批处理文件中或做成批处理文件调用。<br>这里的“^G”属于特殊符号的使用，请看本文后面的章节</p>
<h4 id="PAUSE-暂停"><a href="#PAUSE-暂停" class="headerlink" title="PAUSE 暂停"></a>PAUSE 暂停</h4><p>   PAUSE，玩游戏的人都知道，暂停的意思<br>   在这里就是停止系统命令的执行并显示下面的内容。</p>
<p>例：<br><code>C:&gt;PAUSE</code></p>
<p>运行显示：<br><code>请按任意键继续. . .</code></p>
<p>要显示其他提示语，可以这样用：<br><code>Echo 其他提示语 &amp; pause &gt; nul</code></p>
<h4 id="errorlevel-程序返回码"><a href="#errorlevel-程序返回码" class="headerlink" title="errorlevel  程序返回码"></a>errorlevel  程序返回码</h4><p>echo %errorlevel%<br>每个命令运行结束，可以用这个命令行格式查看返回码<br>用于判断刚才的命令是否执行成功<br>默认值为0，一般命令执行出错会设 errorlevel 为1</p>
<h4 id="title-设置cmd窗口的标题"><a href="#title-设置cmd窗口的标题" class="headerlink" title="title 设置cmd窗口的标题"></a>title 设置cmd窗口的标题</h4><p>设置cmd窗口的标题，批处理编程常用。<br>title 新标题        #可以看到cmd窗口的标题栏变了</p>
<h4 id="COLOR-设置cmd窗口前景和背景颜色"><a href="#COLOR-设置cmd窗口前景和背景颜色" class="headerlink" title="COLOR 设置cmd窗口前景和背景颜色"></a>COLOR 设置cmd窗口前景和背景颜色</h4><p>设置默认的控制台前景和背景颜色。批处理编程常用。</p>
<p>COLOR [attr]</p>
<p>  attr        指定控制台输出的颜色属性</p>
<p>颜色属性由两个十六进制数字指定 – 第一个为背景，第二个则为<br>前景。每个数字可以为以下任何值之一：</p>
<pre><code>0 = 黑色       8 = 灰色
1 = 蓝色       9 = 淡蓝色
2 = 绿色       A = 淡绿色
3 = 湖蓝色     B = 淡浅绿色
4 = 红色       C = 淡红色
5 = 紫色       D = 淡紫色
6 = 黄色       E = 淡黄色
7 = 白色       F = 亮白色
</code></pre><p>如果没有给定任何参数，该命令会将颜色还原到 CMD.EXE 启动时<br>的颜色。这个值来自当前控制台窗口. /T 开关或<br>DefaultColor 注册表值。</p>
<p>如果用相同的前景和背景颜色来执行 COLOR 命令，COLOR 命令<br>会将 ERRORLEVEL 设置为 1。</p>
<p>例如： “COLOR fc” 在亮白色上产生亮红色</p>
<h4 id="mode-配置系统设备"><a href="#mode-配置系统设备" class="headerlink" title="mode 配置系统设备"></a>mode 配置系统设备</h4><p>配置系统设备。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">串行口:　　　     MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]</span><br><span class="line">                                [to=on|off] [xon=on|off] [odsr=on|off]</span><br><span class="line">                                [octs=on|off] [dtr=on|off|hs]</span><br><span class="line">                                [rts=on|off|hs|tg] [idsr=on|off]</span><br><span class="line"></span><br><span class="line">设备状态:      MODE [device] [/STATUS]</span><br><span class="line"></span><br><span class="line">打印重定向:　　 MODE LPTn[:]=COMm[:]</span><br><span class="line"></span><br><span class="line">选定代码页:　　 MODE CON[:] CP SELECT=yyy</span><br><span class="line"></span><br><span class="line">代码页状态:　　 MODE CON[:] CP [/STATUS]</span><br><span class="line"></span><br><span class="line">显示模式:　　   MODE CON[:] [COLS=c] [LINES=n]</span><br><span class="line"></span><br><span class="line">击键率:　       MODE CON[:] [RATE=r DELAY=d]</span><br></pre></td></tr></table></figure></p>
<p>例：设置dos窗口和颜色<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">mode</span> <span class="built_in">con</span> cols=<span class="number">113</span> lines=<span class="number">15</span> &amp; <span class="built_in">color</span> <span class="number">9</span>f</span><br></pre></td></tr></table></figure></p>
<p>此命令设置DOS窗口大小：15行，113列</p>
<h4 id="GOTO-和"><a href="#GOTO-和" class="headerlink" title="GOTO 和 :"></a>GOTO 和 <code>:</code></h4><p>GOTO会点编程的朋友就会知道这是跳转的意思。<br>在批处理中允许以<code>:XXX</code>来构建一个标号，然后用<code>GOTO XXX</code>跳转到标号<code>:XXX</code>处，然后执行标号后的命令。<br>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> &#123;%<span class="number">1</span>&#125;==&#123;&#125; <span class="keyword">goto</span> noparms</span><br><span class="line"><span class="keyword">if</span> "%<span class="number">2</span>"=="" <span class="keyword">goto</span> noparms</span><br></pre></td></tr></table></figure></p>
<p>标签的名字可以随便起，但是最好是有意义的字符串啦，前加个冒号用来表示这个字符串是标签，goto命令就是根据这个冒号<code>:</code>来寻找下一步跳到到那里。最好有一些说明这样你别人看起来才会理解你的意图啊。</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line">:<span class="built_in">start</span></span><br><span class="line"><span class="built_in">set</span> /a var+=<span class="number">1</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%var%</span> <span class="keyword">leq</span> <span class="number">3</span> <span class="keyword">GOTO</span> <span class="built_in">start</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td></tr></table></figure></p>
<h4 id="find-在文件中搜索字符串"><a href="#find-在文件中搜索字符串" class="headerlink" title="find 在文件中搜索字符串"></a>find 在文件中搜索字符串</h4><p>在文件中搜索字符串。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">FIND</span> [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][<span class="built_in">path</span>]filename[ ...]]</span><br><span class="line"></span><br><span class="line">  /V        显示所有未包含指定字符串的行。</span><br><span class="line">  /C        仅显示包含字符串的行数。</span><br><span class="line">  /N        显示行号。</span><br><span class="line">  /I        搜索字符串时忽略大小写。</span><br><span class="line">  /OFF[LINE] 不要跳过具有脱机属性集的文件。</span><br><span class="line">  "string"  指定要搜索的文字串，</span><br><span class="line">  [drive:][<span class="built_in">path</span>]filename</span><br><span class="line">            指定要搜索的文件。</span><br></pre></td></tr></table></figure></p>
<p>如果没有指定路径，FIND 将搜索键入的或者由另一命令产生的文字。</p>
<p>Find常和type命令结合使用<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">Type</span> [drive:][<span class="built_in">path</span>]filename | <span class="built_in">find</span> "string" [&gt;tmpfile] #挑选包含string的行</span><br><span class="line"><span class="built_in">Type</span> [drive:][<span class="built_in">path</span>]filename | <span class="built_in">find</span> /v "string"   #剔除文件中包含string的行</span><br><span class="line"><span class="built_in">Type</span> [drive:][<span class="built_in">path</span>]filename | <span class="built_in">find</span> /c   #显示文件行数</span><br></pre></td></tr></table></figure></p>
<p>以上用法将去除find命令自带的提示语（文件名提示）</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> <span class="number">111</span> &gt;test.txt</span><br><span class="line"><span class="built_in">echo</span> <span class="number">222</span> &gt;&gt;test.txt</span><br><span class="line"><span class="built_in">find</span> "<span class="number">111</span>" test.txt</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示如下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">---------- TEST.TXT</span><br><span class="line">111</span><br><span class="line">请按任意键继续. . .</span><br><span class="line">`</span><br></pre></td></tr></table></figure></p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> <span class="number">111</span> &gt;test.txt</span><br><span class="line"><span class="built_in">echo</span> <span class="number">222</span> &gt;&gt;test.txt</span><br><span class="line"><span class="built_in">type</span> test.txt|<span class="built_in">find</span> "<span class="number">111</span>" </span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示如下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">111</span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<h4 id="start-调用外部程序并任其在新窗口自行运行"><a href="#start-调用外部程序并任其在新窗口自行运行" class="headerlink" title="start 调用外部程序并任其在新窗口自行运行"></a>start 调用外部程序并任其在新窗口自行运行</h4><p>批处理中调用外部程序的命令（该外部程序在新窗口中运行，批处理程序继续往下执行，不理会外部程序的运行状况），如果直接运行外部程序则必须等外部程序完成后才继续执行剩下的指令</p>
<p>例：<code>start explorer d:\</code><br>调用图形界面打开D盘</p>
<h4 id="assoc-和-ftype"><a href="#assoc-和-ftype" class="headerlink" title="assoc 和 ftype"></a>assoc 和 ftype</h4><p>文件关联，不常用。<br>assoc 设置’文件扩展名’关联，关联到’文件类型’<br>ftype 设置’文件类型’关联，关联到’执行程序和参数’<br>当你双击一个.txt文件时，windows并不是根据.txt直接判断用 notepad.exe 打开<br>而是先判断.txt属于 txtfile ‘文件类型’<br>再调用 txtfile 关联的命令行 txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1<br>可以在”文件夹选项”→”文件类型”里修改这2种关联<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">assoc           #显示所有&apos;文件扩展名&apos;关联</span><br><span class="line">assoc .txt      #显示.txt代表的&apos;文件类型&apos;，结果显示 .txt=txtfile</span><br><span class="line">assoc .doc      #显示.doc代表的&apos;文件类型&apos;，结果显示 .doc=Word.Document.8</span><br><span class="line">assoc .exe      #显示.exe代表的&apos;文件类型&apos;，结果显示 .exe=exefile</span><br><span class="line">ftype           #显示所有&apos;文件类型&apos;关联</span><br><span class="line">ftype exefile   #显示exefile类型关联的命令行，结果显示 exefile=&quot;%1&quot; %*</span><br></pre></td></tr></table></figure></p>
<p><code>assoc .txt=Word.Document.8</code><br>设置.txt为word类型的文档，可以看到.txt文件的图标都变了<br><code>assoc .txt=txtfile</code><br>恢复.txt的正确关联</p>
<p><code>ftype exefile=&quot;%1&quot; %*</code><br>恢复 exefile 的正确关联<br>如果该关联已经被破坏，可以运行 command.com ，再输入这条命令</p>
<h4 id="pushd-和-popd"><a href="#pushd-和-popd" class="headerlink" title="pushd 和 popd"></a>pushd 和 popd</h4><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">PUSHD</span> [<span class="built_in">path</span> | ..] 保存当前目录，然后切换到另一个指定的目录<span class="built_in">path</span>。</span><br><span class="line"><span class="built_in">popd</span>  将当前目录恢复为<span class="built_in">pushd</span>命令保存的目录</span><br></pre></td></tr></table></figure>
<figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="function">c: &amp; <span class="title">cd</span>\ &amp; <span class="title">md</span> <span class="title">mp3</span>       #在 <span class="title">C</span>:\ 建立 <span class="title">mp3</span> 文件夹</span></span><br><span class="line"><span class="function"><span class="title">md</span> <span class="title">d</span>:\<span class="title">mp4</span>               #在 <span class="title">D</span>:\ 建立 <span class="title">mp4</span> 文件夹</span></span><br><span class="line"><span class="function"><span class="title">cd</span> /<span class="title">d</span> <span class="title">d</span>:\<span class="title">mp4</span>            #更改当前目录为 <span class="title">d</span>:\<span class="title">mp4</span>，<span class="title">cd</span>命令的/<span class="title">d</span>参数可改变盘符。</span></span><br><span class="line"><span class="function"><span class="title">pushd</span> <span class="title">c</span>:\<span class="title">mp3</span>            #保存当前目录，并切换当前目录为 <span class="title">c</span>:\<span class="title">mp3</span></span></span><br><span class="line"><span class="function"><span class="title">popd</span>                    #恢复当前目录为刚才保存的 <span class="title">d</span>:\<span class="title">mp4</span></span></span><br></pre></td></tr></table></figure>
<p>一般用处不大，在当前目录名不确定时，会有点帮助。（dos编程中很有用）</p>
<h4 id="CALL-调用批处理程序或命令并等待其执行完毕"><a href="#CALL-调用批处理程序或命令并等待其执行完毕" class="headerlink" title="CALL 调用批处理程序或命令并等待其执行完毕"></a>CALL 调用批处理程序或命令并等待其执行完毕</h4><p>CALL命令可以在批处理执行过程中调用另一个批处理，当另一个批处理执行完后，再继续执行原来的批处理。<br>调用一条批处理命令，和直接执行命令效果一样，特殊情况下很有用，比如变量的多级嵌套，见教程后面。在批处理编程中，可以根据一定条件生成命令字符串，用call可以执行该字符串，见例子。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">CALL</span> [drive:][<span class="built_in">path</span>]filename [batch-parameters]</span><br></pre></td></tr></table></figure></p>
<p>调用的其它批处理程序。filename 参数必须具有 .bat 或 .cmd 扩展名。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">CALL</span> :<span class="built_in">label</span> arguments</span><br></pre></td></tr></table></figure></p>
<p>调用本文件内命令段，相当于子程序。被调用的命令段以标签<code>:label</code>开头<br>以命令<code>goto :eof</code>结尾。</p>
<p>另外，批脚本文本参数参照(%0. %1. 等等)已如下改变：</p>
<p>批脚本里的 %* 指出所有的参数(如 %1 %2 %3 %4 %5 …)</p>
<p>批参数(%n)的替代已被增强。您可以使用以下语法：（看不明白的直接运行后面的例子）<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">%~<span class="number">1</span>         - 删除引号(")，扩充 %<span class="number">1</span></span><br><span class="line">%~f1        - 将 %<span class="number">1</span> 扩充到一个完全合格的路径名</span><br><span class="line">%~d1        - 仅将 %<span class="number">1</span> 扩充到一个驱动器号</span><br><span class="line">%~p1        - 仅将 %<span class="number">1</span> 扩充到一个路径</span><br><span class="line">%~n1        - 仅将 %<span class="number">1</span> 扩充到一个文件名</span><br><span class="line">%~x1        - 仅将 %<span class="number">1</span> 扩充到一个文件扩展名</span><br><span class="line">%~s1        - 扩充的路径指含有短名</span><br><span class="line">%~a1        - 将 %<span class="number">1</span> 扩充到文件属性</span><br><span class="line">%~t1        - 将 %<span class="number">1</span> 扩充到文件的日期/时间</span><br><span class="line">%~z1        - 将 %<span class="number">1</span> 扩充到文件的大小</span><br><span class="line">%~$<span class="built_in">PATH</span> : <span class="number">1</span> - 查找列在 <span class="built_in">PATH</span> 环境变量的目录，并将 %<span class="number">1</span></span><br><span class="line">              扩充到找到的第一个完全合格的名称。如果环境</span><br><span class="line">              变量名未被定义，或者没有找到文件，此组合键会</span><br><span class="line">              扩充到空字符串</span><br></pre></td></tr></table></figure></p>
<p>可以组合修定符来取得多重结果：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">%~dp1       - 只将 %<span class="number">1</span> 扩展到驱动器号和路径</span><br><span class="line">%~nx1       - 只将 %<span class="number">1</span> 扩展到文件名和扩展名</span><br><span class="line">%~dp$<span class="built_in">PATH</span>:<span class="number">1</span> - 在列在 <span class="built_in">PATH</span> 环境变量中的目录里查找 %<span class="number">1</span>，</span><br><span class="line">               并扩展到找到的第一个文件的驱动器号和路径。</span><br><span class="line">%~ftza1     - 将 %<span class="number">1</span> 扩展到类似 <span class="built_in">DIR</span> 的输出行。</span><br></pre></td></tr></table></figure></p>
<p>在上面的例子中，%1 和 PATH 可以被其他有效数值替换。<br>%~ 语法被一个有效参数号码终止。%~ 修定符不能跟 %*使用<br>注意：参数扩充时不理会参数所代表的文件是否真实存在，均以当前目录进行扩展</p>
<p>要理解上面的知识，下面的例子很关键。</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">Echo</span> 产生一个临时文件 &gt; tmp.txt</span><br><span class="line"><span class="comment">Rem 下行先保存当前目录，再将c:\windows设为当前目录</span></span><br><span class="line"><span class="built_in">pushd</span> c:\windows</span><br><span class="line"><span class="keyword">Call</span> :sub tmp.txt</span><br><span class="line"><span class="comment">Rem 下行恢复前次的当前目录</span></span><br><span class="line"><span class="built_in">Popd</span></span><br><span class="line"><span class="keyword">Call</span> :sub tmp.txt</span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"><span class="built_in">Del</span> tmp.txt</span><br><span class="line"><span class="keyword">exit</span></span><br><span class="line">:sub</span><br><span class="line"><span class="built_in">Echo</span> 删除引号： %~<span class="number">1</span></span><br><span class="line"><span class="built_in">Echo</span> 扩充到路径： %~f1</span><br><span class="line"><span class="built_in">Echo</span> 扩充到一个驱动器号： %~d1</span><br><span class="line"><span class="built_in">Echo</span> 扩充到一个路径： %~p1 </span><br><span class="line"><span class="built_in">Echo</span> 扩充到一个文件名： %~n1</span><br><span class="line"><span class="built_in">Echo</span> 扩充到一个文件扩展名： %~x1</span><br><span class="line"><span class="built_in">Echo</span> 扩充的路径指含有短名： %~s1 </span><br><span class="line"><span class="built_in">Echo</span> 扩充到文件属性： %~a1 </span><br><span class="line"><span class="built_in">Echo</span> 扩充到文件的日期/时间： %~t1 </span><br><span class="line"><span class="built_in">Echo</span> 扩充到文件的大小： %~z1 </span><br><span class="line"><span class="built_in">Echo</span> 扩展到驱动器号和路径：%~dp1</span><br><span class="line"><span class="built_in">Echo</span> 扩展到文件名和扩展名：%~nx1</span><br><span class="line"><span class="built_in">Echo</span> 扩展到类似 <span class="built_in">DIR</span> 的输出行：%~ftza1</span><br><span class="line"><span class="built_in">Echo</span>.</span><br><span class="line"><span class="keyword">Goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">set</span> aa=<span class="number">123456</span></span><br><span class="line"><span class="built_in">set</span> cmdstr=<span class="built_in">echo</span> <span class="variable">%aa%</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%cmdstr%</span></span><br><span class="line"><span class="keyword">call</span> <span class="variable">%cmdstr%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>本例中如果不用call，而直接运行%cmdstr%，将显示结果%aa%，而不是123456</p>
<h4 id="shift"><a href="#shift" class="headerlink" title="shift"></a>shift</h4><p>更改批处理文件中可替换参数的位置。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">SHIFT</span> [/n]</span><br></pre></td></tr></table></figure></p>
<p>如果命令扩展名被启用，SHIFT 命令支持/n 命令行开关；该命令行开关告诉<br>命令从第 n 个参数开始移位；n 介于零和八之间。例如：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">SHIFT</span> /<span class="number">2</span></span><br></pre></td></tr></table></figure></p>
<p>会将 %3 移位到 %2，将 %4 移位到 %3，等等；并且不影响 %0 和 %1。</p>
<h4 id="IF"><a href="#IF" class="headerlink" title="IF"></a>IF</h4><p>IF 条件判断语句，语法格式如下：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">IF</span> [<span class="keyword">NOT</span>] <span class="keyword">ERRORLEVEL</span> number command</span><br><span class="line"><span class="keyword">IF</span> [<span class="keyword">NOT</span>] string1==string2 command</span><br><span class="line"><span class="keyword">IF</span> [<span class="keyword">NOT</span>] <span class="keyword">EXIST</span> filename command</span><br></pre></td></tr></table></figure></p>
<p>下面逐一介绍，更详细的分析请看后面章节。</p>
<p>(1) IF [NOT] ERRORLEVEL number command<br>IF ERRORLEVEL这个句子必须放在某一个命令的后面，执行命令后由IF ERRORLEVEL 来判断命令的返回值。<br>Number的数字取值范围0~255，判断时值的排列顺序应该由大到小。返回的值大于等于指定的值时，条件成立</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">dir</span> c:</span><br></pre></td></tr></table></figure></p>
<p>rem退出代码为&gt;=1就跳至标题1处执行，&gt;=0就跳至标题0处执行<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">IF</span> <span class="keyword">ERRORLEVEL</span> <span class="number">1</span> <span class="keyword">goto</span> <span class="number">1</span></span><br><span class="line"><span class="keyword">IF</span> <span class="keyword">ERRORLEVEL</span> <span class="number">0</span> <span class="keyword">goto</span> <span class="number">0</span></span><br><span class="line">`</span><br></pre></td></tr></table></figure></p>
<p>Rem 上面的两行不可交换位置，否则失败了也显示成功。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">:<span class="number">0</span></span><br><span class="line"><span class="built_in">echo</span> 命令执行成功！</span><br></pre></td></tr></table></figure></p>
<p>Rem 程序执行完毕跳至标题exit处退出<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">goto</span> <span class="keyword">exit</span></span><br><span class="line">:<span class="number">1</span></span><br><span class="line"><span class="built_in">echo</span> 命令执行失败！</span><br></pre></td></tr></table></figure></p>
<p>Rem 程序执行完毕跳至标题exit处退出<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">goto</span> <span class="keyword">exit</span></span><br><span class="line">:<span class="keyword">exit</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：命令执行成功！</p>
<p>(2) IF [NOT] string1==string2 command<br>string1和string2都为字符的数据，英文内字符的大小写将看作不同，这个条件中的等于号必须是两个（绝对相等的意思），条件成立即执行后面的command</p>
<p>检测当前变量的值做出判断，为了防止字符串中含有空格，可用以下格式<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> [<span class="keyword">NOT</span>] &#123;string1&#125;==&#123;string2&#125; command</span><br><span class="line"><span class="keyword">if</span> [<span class="keyword">NOT</span>] [string1]==[string2] command</span><br><span class="line"><span class="keyword">if</span> [<span class="keyword">NOT</span>] "string1"=="string2" command</span><br></pre></td></tr></table></figure></p>
<p>这种写法实际上将括号或引号当成字符串的一部分了，只要等号左右两边一致就行了，比如下面的写法就不行：<br>if {string1}==[string2] command</p>
<p>(3) IF [NOT] EXIST filename command<br>EXIST filename为文件或目录存在的意思<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">IF</span> <span class="keyword">EXIST</span> autoexec.bat <span class="built_in">echo</span> 文件存在！</span><br><span class="line"><span class="keyword">IF</span> <span class="keyword">not</span> <span class="keyword">EXIST</span> autoexec.bat <span class="built_in">echo</span> 文件不存在！</span><br></pre></td></tr></table></figure></p>
<p>这个批处理大家可以放在C盘和D盘分别执行，看看效果</p>
<h4 id="setlocal-与-变量延迟"><a href="#setlocal-与-变量延迟" class="headerlink" title="setlocal 与 变量延迟"></a>setlocal 与 变量延迟</h4><p>本条内容引用[英雄出品]的批处理教程：</p>
<p>要想进阶，变量延迟是必过的一关！所以这一部分希望你能认真看。</p>
<p>为了更好的说明问题，我们先引入一个例子。<br>例1：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a=<span class="number">4</span></span><br><span class="line"><span class="built_in">set</span> a=<span class="number">5</span> &amp; <span class="built_in">echo</span> <span class="variable">%a%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>结果：4<br>解说：为什么是4而不是5呢？在echo之前明明已经把变量a的值改成5了？</p>
<p>让我们先了解一下批处理运行命令的机制：</p>
<p>批处理读取命令时是按行读取的（另外例如for命令等，其后用一对圆括号闭合的所有语句也当作一行），在读取某行命令时，如果其中有变量，则变量值应该取上一行的值。所以在读取命令“set a=5 &amp; echo %a%”时，dos将其预处理为“set a=5 &amp; echo 4”，然后执行。而其中的a=5所做的数值变更，只能在下一命令行才能体现了。</p>
<p>而为了能够及时感知环境变量的动态变化，批处理设计了变量延迟。简单来说，在读取了一条完整的语句之后，不立即对该行的变量赋值，而会在某个单条语句执行之前再进行赋值，也就是说“延迟”了对变量的赋值。</p>
<p>那么如何开启变量延迟呢？变量延迟又需要注意什么呢？举个例子说明一下：</p>
<p>例2：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">setlocal</span> enabledelayedexpansion</span><br><span class="line"><span class="built_in">set</span> a=<span class="number">4</span></span><br><span class="line"><span class="built_in">set</span> a=<span class="number">5</span> &amp; <span class="built_in">echo</span> <span class="variable">!a!</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>结果：5<br>解说：启动了变量延迟，得到了正确答案。变量延迟的启动语句是“setlocal enabledelayedexpansion”，并且变量要用一对叹号“!!”括起来（注意要用英文的叹号），否则就没有变量延迟的效果。</p>
<p>分析一下例2，首先“setlocal enabledelayedexpansion”开启变量延迟，然后“set a=4”先给变量a赋值为4，“set a=5 &amp; echo !a!”这句是给变量a赋值为5并输出（由于启动了变量延迟，所以批处理能够感知到动态变化，即不是先给该行变量赋值，而是在运行过程中给变量赋值，因此此时a的值就是5了）。</p>
<p>再举一个例子巩固一下。<br>例3：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">setlocal</span> enabledelayedexpansion</span><br><span class="line"><span class="keyword">for</span> /l <span class="variable">%%i</span> <span class="keyword">in</span> (<span class="number">1</span>,<span class="number">1</span>,<span class="number">5</span>) <span class="keyword">do</span> (</span><br><span class="line"><span class="built_in">set</span> a=<span class="variable">%%i</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">!a!</span></span><br><span class="line">)</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>结果：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td></tr></table></figure></p>
<p>解说：本例开启了变量延迟并用“!!”将变量扩起来，因此得到我们预期的结果。如果不用变量延迟会出现什么结果呢？结果是这样的：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">ECHO 处于关闭状态。</span><br><span class="line">ECHO 处于关闭状态。</span><br><span class="line">ECHO 处于关闭状态。</span><br><span class="line">ECHO 处于关闭状态。</span><br><span class="line">ECHO 处于关闭状态。</span><br></pre></td></tr></table></figure></p>
<p>即没有感知到for语句中的动态变化。</p>
<p>提示：在没有开启变量延迟的情况下，某条命令行中的变量改变，必须到下一条命令才能体现。这一点也可以加以利用，看例子。</p>
<p>例4：交换两个变量的值，且不用中间变量<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line">::交换两个变量的值，但是不使用临时变量</span><br><span class="line"><span class="built_in">set</span> var1=abc</span><br><span class="line"><span class="built_in">set</span> var2=<span class="number">123</span></span><br><span class="line"><span class="built_in">echo</span> 交换前： var1=<span class="variable">%var1%</span> var2=<span class="variable">%var2%</span></span><br><span class="line"><span class="built_in">set</span> var1=<span class="variable">%var2%</span>&amp; <span class="built_in">set</span> var2=<span class="variable">%var1%</span></span><br><span class="line"><span class="built_in">echo</span> 交换后： var1=<span class="variable">%var1%</span> var2=<span class="variable">%var2%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">交换前： var1=abc var2=123</span><br><span class="line">交换后： var1=123 var2=abc</span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<p>在代码中，使用 setlocal enabledelayedexpansion 语句来启用变量延迟之后，有得有失：</p>
<p>优点：<br>(a). 可以在同一语句内部直接使用上一次改变后的变量；<br>(b). 在echo特殊字符的时候，无须用引号括起来，比如变量的值含有<code>&lt;</code> <code>&gt;</code> <code>|</code>等字符的时候，直接使用 echo !str! 就可以了；</p>
<p>缺点：<br>(a). 会把文本中所有的感叹号抛弃；<br>(b). 增加代码的复杂度，有时容易出错。</p>
<h4 id="ATTRIB-显示或更改文件属性"><a href="#ATTRIB-显示或更改文件属性" class="headerlink" title="ATTRIB  显示或更改文件属性"></a>ATTRIB  显示或更改文件属性</h4><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ATTRIB</span> [+R|-R] [+A|-A] [+S|-S] [+H|-H] [[drive:] [<span class="built_in">path</span>] filename] [/S [/D]]</span><br><span class="line"></span><br><span class="line">  +   设置属性。</span><br><span class="line">  -    清除属性。</span><br><span class="line">  R   只读文件属性。</span><br><span class="line">  A   存档文件属性。</span><br><span class="line">  S   系统文件属性。</span><br><span class="line">  H   隐藏文件属性。</span><br><span class="line">  [drive:][<span class="built_in">path</span>][filename]</span><br><span class="line">      指定要处理的文件属性。</span><br><span class="line">  /S  处理当前文件夹及其子文件夹中的匹配文件。</span><br><span class="line">  /D  也处理文件夹。</span><br></pre></td></tr></table></figure>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">md</span> autorun</span><br><span class="line"><span class="built_in">attrib</span> +a +s +h autorun</span><br></pre></td></tr></table></figure></p>
<p>上面的命令将建立文件夹autorun，然后将其设为存档. 系统. 隐藏属性</p>
<h4 id="findstr-在文件中搜索字符串（find增强版）"><a href="#findstr-在文件中搜索字符串（find增强版）" class="headerlink" title="findstr 在文件中搜索字符串（find增强版）"></a>findstr 在文件中搜索字符串（find增强版）</h4><p>find命令不能处理文件中超过1024个字符的数据行，此时可用findstr命令。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">FINDSTR</span> [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/F:file]</span><br><span class="line">        [/C:string] [/G:file] [/D:<span class="built_in">dir</span> list] [/A:<span class="built_in">color</span> attributes] [/OFF[LINE]]</span><br><span class="line">        strings [[drive:][<span class="built_in">path</span>]filename[ ...]]</span><br><span class="line"></span><br><span class="line">  /B        在一行的开始配对模式。</span><br><span class="line">  /E        在一行的结尾配对模式。</span><br><span class="line">  /L        按字使用搜索字符串。</span><br><span class="line">  /R        将搜索字符串作为一般表达式使用。</span><br><span class="line">  /S        在当前目录和所有子目录中搜索</span><br><span class="line">              匹配文件。</span><br><span class="line">  /I         指定搜索不分大小写。</span><br><span class="line">  /X        打印完全匹配的行。</span><br><span class="line">  /V        只打印不包含匹配的行。</span><br><span class="line">  /N        在匹配的每行前打印行数。</span><br><span class="line">  /M        如果文件含有匹配项，只打印其文件名。</span><br><span class="line">  /O        在每个匹配行前打印字符偏移量。</span><br><span class="line">  /P        忽略有不可打印字符的文件。</span><br><span class="line">  /OFF[LINE] 不跳过带有脱机属性集的文件。</span><br><span class="line">  /A:attr   指定有十六进位数字的颜色属性。请见 "<span class="built_in">color</span> /?"</span><br><span class="line">  /F:file   从指定文件读文件列表 (/ 代表控制台)。</span><br><span class="line">  /C:string 使用指定字符串作为文字搜索字符串。</span><br><span class="line">  /G:file   从指定的文件获得搜索字符串。 (/ 代表控制台)。</span><br><span class="line">  /D:<span class="built_in">dir</span>    查找以分号为分隔符的目录列表</span><br><span class="line">  strings   要查找的文字。</span><br><span class="line">  [drive:][<span class="built_in">path</span>]filename</span><br><span class="line">            指定要查找的文件。</span><br></pre></td></tr></table></figure></p>
<p>除非参数有 /C 前缀，请使用空格隔开搜索字符串。<br>例如： <code>FINDSTR &quot;hello there&quot; x.y</code> 在文件 <code>x.y</code> 中寻找 “hello” 或<br>“there” 。  <code>FINDSTR /C:&quot;hello there&quot; x.y</code> 在文件 <code>x.y</code>  中寻找<br>“hello there”。</p>
<p>一般表达式的快速参考：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">.        通配符: 任何字符</span><br><span class="line">*        重复: 以前字符或类别出现零或零以上次数</span><br><span class="line">^        行位置: 行的开始</span><br><span class="line">$        行位置: 行的终点</span><br><span class="line">[class]  字符类别: 任何在字符集中的字符</span><br><span class="line">[^class] 补字符类别: 任何不在字符集中的字符</span><br><span class="line">[x-y]    范围: 在指定范围内的任何字符</span><br><span class="line">\x       Escape: 元字符 x 的文字用法</span><br><span class="line">\&lt;xyz    字位置: 字的开始</span><br><span class="line">xyz\&gt;    字位置: 字的结束</span><br></pre></td></tr></table></figure></p>
<p>有关 FINDSTR 常见表达法的详细情况，请见联机命令参考。</p>
<h4 id="date-t-和-time-t"><a href="#date-t-和-time-t" class="headerlink" title="date /t 和 time /t"></a><code>date /t</code> 和 <code>time /t</code></h4><p>date /t 直接显示当前日期，可用来提取或显示日期。</p>
<p>time /t 直接显示当前时间，可用来提取或显示时间。</p>
<h3 id="第二节-常用特殊符号"><a href="#第二节-常用特殊符号" class="headerlink" title="第二节 常用特殊符号"></a>第二节 常用特殊符号</h3><h4 id="命令行回显屏蔽符"><a href="#命令行回显屏蔽符" class="headerlink" title="@  命令行回显屏蔽符"></a><code>@</code>  命令行回显屏蔽符</h4><p>这个字符在批处理中的意思是关闭当前行的回显。我们从前几课知道<br>ECHO OFF可以关闭掉整个批处理命令的回显，但不能关掉ECHO OFF这个命令，现在我们在ECHO OFF这个命令前加个@，就可以达到所有命令均不回显的要求</p>
<h4 id="批处理变量引导符"><a href="#批处理变量引导符" class="headerlink" title="%  批处理变量引导符"></a><code>%</code>  批处理变量引导符</h4><p>这个百分号严格来说是算不上命令的，它只是批处理中的参数而已（多个%一起使用的情况除外，以后还将详细介绍）。<br>引用变量用%var%，调用程序外部参数用%1至%9等等<br>%0  %1  %2  %3  %4  %5  %6  %7  %8  %9  %<em>为命令行传递给批处理的参数<br>%0 批处理文件本身，包括完整的路径和扩展名<br>%1 第一个参数<br>%9 第九个参数<br>%</em> 从第一个参数开始的所有参数<br>参数%0具有特殊的功能，可以调用批处理自身，以达到批处理本身循环的目的，也可以复制和删除文件自身等等。</p>
<p>例：最简单的复制文件自身的方法<br>copy %0 d:\wind.bat</p>
<p>小技巧：添加行内注释<br>%注释内容%（可以用作行内注释，不能出现重定向符号和管道符号）<br>为什么这样呢？此时“注释内容”其实被当作变量，其值是空的，故只起注释作用，不过这种用法容易出现语法错误，一般不用。</p>
<h4 id="gt-输出重定向符"><a href="#gt-输出重定向符" class="headerlink" title="&gt;   输出重定向符"></a><code>&gt;</code>   输出重定向符</h4><p>输出重定向命令<br>这个字符的意思是传递并且覆盖，他所起的作用是将运行的结果传递到后面的范围（后边可以是文件，也可以是默认的系统控制台）<br>    在NT系列命令行中，重定向的作用范围由整个命令行转变为单个命令语句，受到了命令分隔符&amp;,&amp;&amp;,||和语句块的制约限制。</p>
<p>比如：<br>使用命令：<code>echo hello &gt;1.txt</code>将建立文件 1.txt，内容为“hello ”（注意行尾有一空格）<br>使用命令：<code>echo hello&gt;1.txt</code>将建立文件 1.txt，内容为“hello”（注意行尾没有空格）</p>
<h4 id="gt-gt-输出重定向符"><a href="#gt-gt-输出重定向符" class="headerlink" title="&gt;&gt;  输出重定向符"></a><code>&gt;&gt;</code>  输出重定向符</h4><p>输出重定向命令<br>这个符号的作用和<code>&gt;</code>有点类似，但他们的区别是<code>&gt;&gt;</code>是传递并在文件的末尾追加，而<code>&gt;</code>是覆盖</p>
<p>用法同上</p>
<p>同样拿1.txt做例子</p>
<p>使用命令：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">echo</span> hello &gt; <span class="number">1</span>.txt</span><br><span class="line"><span class="built_in">echo</span> world &gt;&gt;<span class="number">1</span>.txt</span><br></pre></td></tr></table></figure></p>
<p>这时候1.txt 内容如下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hello</span><br><span class="line">world</span><br></pre></td></tr></table></figure></p>
<h4 id="lt-gt-amp-lt-amp-重定向符"><a href="#lt-gt-amp-lt-amp-重定向符" class="headerlink" title="&lt; &gt;&amp; &lt;&amp; 重定向符"></a><code>&lt;</code> <code>&gt;&amp;</code> <code>&lt;&amp;</code> 重定向符</h4><p>这三个命令也是管道命令，但<code>&gt;&amp;</code> <code>&lt;&amp;</code>一般不常用，你只需要知道一下就ok了，当然如果想仔细研究的话，可以自己查一下资料。(本人已查过，网上也查不到相关资料)</p>
<p><code>&lt;</code>输入重定向命令，从文件中读入命令输入，而不是从键盘中读入。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> <span class="number">2005</span>-<span class="number">05</span>-<span class="number">01</span>&gt;temp.txt</span><br><span class="line"><span class="built_in">set</span> /p today=&lt;temp.txt</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%today%</span></span><br><span class="line"><span class="built_in">del</span> temp.txt</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">2005-05-01</span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<p><code>&gt;&amp;</code> 将一个句柄的输出写入到另一个句柄的输入中。<br><code>&lt;&amp;</code> 刚好和&gt;&amp;相反，从一个句柄读取输入并将其写入到另一个句柄输出中。</p>
<p>常用句柄：0. 1. 2，未定义句柄：3—9<br>1&gt;nul 表示禁止输出正确的信息<br>2&gt;nul 表示禁止输出错误信息。<br>其中的1与2都是代表某个数据流输入输出的地址（NT CMD 称之为句柄，MSDOS称之为设备）。</p>
<p>句柄0：标准输入stdin，键盘输入<br>句柄1：标准输出stdout，输出到命令提示符窗口（console，代码为CON）<br>句柄2：标准错误stderr，输出到命令提示符窗口（console，代码为CON）<br>其中的stdin可被&lt;重定向，stdout可被&gt;. &gt;&gt;重定向。</p>
<p>我们已经知道读取文本中的内容可以用for命令，但如果只需要读取第一行用for命令就有点麻烦。简单的办法如下：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p str=&lt;%<span class="number">0</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%str%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示批处理文件自身的第一行：@echo off</p>
<h4 id="命令管道符"><a href="#命令管道符" class="headerlink" title="|  命令管道符"></a><code>|</code>  命令管道符</h4><p>格式：第一条命令 | 第二条命令 [| 第三条命令…]<br>将第一条命令的结果作为第二条命令的参数来使用，记得在unix中这种方式很常见。</p>
<p>例如：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> c:\|<span class="built_in">find</span> "txt"</span><br></pre></td></tr></table></figure></p>
<p>以上命令是：查找C：\所有，并发现TXT字符串。<br>FIND的功能请用 FIND /? 自行查看</p>
<p>在不使format的自动格式化参数时，我是这样来自动格式化A盘的<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">echo</span> y|<span class="built_in">format</span> a: /s /q /v:system</span><br></pre></td></tr></table></figure></p>
<p>用过format的都知道，再格盘时要输入y来确认是否格盘，这个命令前加上echo y并用|字符来将echo y的结果传给format命令</p>
<p>从而达到自动输入y的目的</p>
<p>（这条命令有危害性，测试时请慎重）</p>
<h4 id="转义字符"><a href="#转义字符" class="headerlink" title="^  转义字符"></a><code>^</code>  转义字符</h4><p>^是对特殊符号&lt;,&gt;,&amp;的前导字符，在命令中他将以上3个符号的特殊功能去掉，仅仅只把他们当成符号而不使用他们的特殊意义。</p>
<p>比如<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">echo</span> test ^&gt;<span class="number">1</span>.txt</span><br></pre></td></tr></table></figure></p>
<p>结果则是：test &gt; 1.txt</p>
<p>他没有追加在1.txt里，只是显示了出来。</p>
<p>另外，此转义字符还可以用作续行符号。<br>举个简单的例子：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> 英雄^</span><br><span class="line">是^</span><br><span class="line">好^</span><br><span class="line">男人</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>不用多说，自己试一下就明白了。</p>
<p>为什么转义字符放在行尾可以起到续行符的作用呢？原因很简单，因为每行末尾还有一个看不见的符号，即回车符，转义字符位于行尾时就让回车符失效了，从而起到了续行的作用。</p>
<h4 id="amp-组合命令（顺序执行）"><a href="#amp-组合命令（顺序执行）" class="headerlink" title="&amp;  组合命令（顺序执行）"></a><code>&amp;</code>  组合命令（顺序执行）</h4><p>语法：第一条命令 &amp; 第二条命令 [&amp; 第三条命令…]<br>&amp;. &amp;&amp;. ||为组合命令，顾名思义，就是可以把多个命令组合起来当一个命令来执行。这在批处理脚本里是允许的，而且用的非常广泛。因为批处理认行不认命令数目。</p>
<p>这个符号允许在一行中使用2个以上不同的命令，当第一个命令执行失败了，也不影响后边的命令执行。<br>这里&amp;两边的命令是顺序执行的，从前往后执行。<br>比如：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> z:\ &amp; <span class="built_in">dir</span> y:\ &amp; <span class="built_in">dir</span> c:\</span><br></pre></td></tr></table></figure></p>
<p>以上命令会连续显示z,y,c盘的内容，不理会该盘是否存在</p>
<h4 id="amp-amp-组合命令（前面指令成功，才执行后面指令）"><a href="#amp-amp-组合命令（前面指令成功，才执行后面指令）" class="headerlink" title="&amp;&amp; 组合命令（前面指令成功，才执行后面指令）"></a><code>&amp;&amp;</code> 组合命令（前面指令成功，才执行后面指令）</h4><p>语法：第一条命令 &amp;&amp; 第二条命令 [&amp;&amp; 第三条命令…]</p>
<p>用这种方法可以同时执行多条命令，当碰到执行出错的命令后将不执行后面的命令，如果一直没有出错则一直执行完所有命令<br>这个命令和上边的类似，但区别是，第一个命令失败时，后边的命令也不会执行<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> z:\ &amp;&amp; <span class="built_in">dir</span> y:\ &amp;&amp; <span class="built_in">dir</span> c:\</span><br></pre></td></tr></table></figure></p>
<h4 id="组合命令（前面指令失败，才执行后面指令）"><a href="#组合命令（前面指令失败，才执行后面指令）" class="headerlink" title="||  组合命令（前面指令失败，才执行后面指令）"></a><code>||</code>  组合命令（前面指令失败，才执行后面指令）</h4><p>语法：第一条命令 || 第二条命令 [|| 第三条命令…]</p>
<p>用这种方法可以同时执行多条命令，当一条命令失败后才执行第二条命令，当碰到执行正确的命令后将不执行后面的命令，如果没有出现正确的命令则一直执行完所有命令；</p>
<p>提示：组合命令和重定向命令一起使用必须注意优先级<br>管道命令的优先级高于重定向命令，重定向命令的优先级高于组合命令</p>
<p>问题：把C盘和D盘的文件和文件夹列出到a.txt文件中。看例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> c:\ &amp;&amp; <span class="built_in">dir</span> d:\ &gt; a.txt</span><br></pre></td></tr></table></figure></p>
<p>这样执行后a.txt里只有D盘的信息！为什么？因为组合命令的优先级没有重定向命令的优先级高！所以这句在执行时将本行分成这两部分：<code>dir c:\</code>和<code>dir d:\ &gt; a.txt</code>，而并不是如你想的这两部分：<code>dir c:\ &amp;&amp; dir d:\</code>和<code>&gt; a.txt</code>。要使用组合命令&amp;&amp;达到题目的要求，必须得这么写：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> c:\ &gt; a.txt &amp;&amp; <span class="built_in">dir</span> d:\ &gt;&gt; a.txt</span><br></pre></td></tr></table></figure></p>
<p>这样，依据优先级高低，DOS将把这句话分成以下两部分：<code>dir c:\ &gt; a.txt</code>和<code>dir d:\ &gt;&gt; a.txt</code>。例十八中的几句的差别比较特殊，值得好好研究体会一下。</p>
<p>当然这里还可以利用&amp;命令（自己想一下道理哦）：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> c:\ &gt; a.txt &amp; <span class="built_in">dir</span> d:\ &gt;&gt; a.txt</span><br></pre></td></tr></table></figure></p>
<h4 id="quot-quot-字符串界定符"><a href="#quot-quot-字符串界定符" class="headerlink" title="&quot;&quot;  字符串界定符"></a><code>&quot;&quot;</code>  字符串界定符</h4><p>双引号允许在字符串中包含空格，进入一个特殊目录可以用如下方法<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> "program files"</span><br><span class="line"><span class="built_in">cd</span> progra~<span class="number">1</span></span><br><span class="line"><span class="built_in">cd</span> pro*</span><br></pre></td></tr></table></figure></p>
<p>以上三种方法都可以进入program files这个目录</p>
<h4 id="逗号"><a href="#逗号" class="headerlink" title=", 逗号"></a><code>,</code> 逗号</h4><p>逗号相当于空格，在某些情况下“,”可以用来当做空格使</p>
<p>比如<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span>,c:\</span><br></pre></td></tr></table></figure></p>
<h4 id="分号"><a href="#分号" class="headerlink" title="; 分号"></a><code>;</code> 分号</h4><p>分号，当命令相同时，可以将不同目标用；来隔离，但执行效果不变，如执行过程中发生错误，则只返回错误报告，但程序仍会执行。（有人说不会继续执行，其实测试一下就知道了）</p>
<p>比如：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> c:\;d:\;e:\;z:\</span><br></pre></td></tr></table></figure></p>
<p>以上命令相当于<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> c:\</span><br><span class="line"><span class="built_in">dir</span> d:\</span><br><span class="line"><span class="built_in">dir</span> e:\</span><br><span class="line"><span class="built_in">dir</span> f:\</span><br></pre></td></tr></table></figure></p>
<p>如果其中z盘不存在，运行显示：系统找不到指定的路径。然后终止命令的执行。</p>
<p>例：<code>dir c:\;d:\;e:\1.txt</code><br>以上命令相当于<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dir</span> c:\</span><br><span class="line"><span class="built_in">dir</span> d:\</span><br><span class="line"><span class="built_in">dir</span> e:\<span class="number">1</span>.txt</span><br></pre></td></tr></table></figure></p>
<p>其中文件<code>e:\1.txt</code>不存在，但e盘存在，有错误提示，但命令仍会执行。</p>
<p>为什么？如果目标路径不存在，则终止执行；如果路径存在，仅文件不存在，则继续执行。</p>
<p>就说这些了!各位有什么意见请回贴!有什么疑问请到BAT交流区发贴!下一节改进!</p>
<h4 id="小括号"><a href="#小括号" class="headerlink" title="() 小括号"></a><code>()</code> 小括号</h4><p>小括号在批处理编程中有特殊的作用，左右括号必须成对使用，括号中可以包括多行命令，这些命令将被看成一个整体，视为一条命令行。</p>
<p>括号在for语句和if语句中常见，用来嵌套使用循环或条件语句，其实括号()也可以单独使用，请看例子。</p>
<p>例：<br>命令：<code>echo 1 &amp; echo 2 &amp; echo 3</code><br>可以写成：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">(</span><br><span class="line"><span class="built_in">echo</span> <span class="number">1</span></span><br><span class="line"><span class="built_in">echo</span> <span class="number">2</span></span><br><span class="line"><span class="built_in">echo</span> <span class="number">3</span></span><br><span class="line">)</span><br></pre></td></tr></table></figure></p>
<p>上面两种写法效果一样，这两种写法都被视为是一条命令行。<br>注意：这种多条命令被视为一条命令行时，如果其中有变量，就涉及到变量延迟的问题。</p>
<h4 id="感叹号"><a href="#感叹号" class="headerlink" title="! 感叹号"></a><code>!</code> 感叹号</h4><p>没啥说的，在变量延迟问题中，用来表示变量，即<code>%var%</code>应该表示为<code>!var!</code>，请看前面的setlocal命令介绍。</p>
<h4 id="批处理中可能会见到的其它特殊标记符-（略）"><a href="#批处理中可能会见到的其它特殊标记符-（略）" class="headerlink" title="批处理中可能会见到的其它特殊标记符: （略）"></a>批处理中可能会见到的其它特殊标记符: （略）</h4><p> <code>CR(0D)</code> 命令行结束符<br> <code>Escape(1B)</code> ANSI转义字符引导符<br> <code>Space(20)</code> 常用的参数界定符<br> <code>Tab(09) ; =</code> 不常用的参数界定符<br> <code>+ COPY</code>命令文件连接符<br> <code>* ?</code> 文件通配符<br> <code>/</code> 参数开关引导符<br> <code>:</code> 批处理标签引导符</p>
<h2 id="第二章-FOR命令详解"><a href="#第二章-FOR命令详解" class="headerlink" title="第二章 FOR命令详解"></a>第二章 FOR命令详解</h2><p>讲FOR之前呢,咋先告诉各位新手朋友,如果你有什么命令不懂,直接在CMD下面输入：<code>name /?</code> 这样的格式来看系统给出的帮助文件,比如<code>for /?</code> 就会把FOR命令的帮助全部显示出来!当然许多菜鸟都看不懂…. 所以才会有那么多批处理文章! 俺也照顾菜鸟,把FOR命令用我自己的方式说明下!</p>
<p>正式开始：</p>
<h3 id="基本格式"><a href="#基本格式" class="headerlink" title="基本格式"></a>基本格式</h3><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> <span class="variable">%%v</span>ariable <span class="keyword">IN</span> (<span class="built_in">set</span>) <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"></span><br><span class="line">  <span class="variable">%%v</span>ariable  指定一个单一字母表示可替换的参数。</span><br><span class="line">  (<span class="built_in">set</span>)      指定一个或一组文件。可以使用通配符。</span><br><span class="line">  command    指定对每个文件执行的命令。</span><br><span class="line">  command-parameters</span><br><span class="line">             为特定命令指定参数或命令行开关。</span><br></pre></td></tr></table></figure>
<p>FOR 有4个参数 /d   /l   /r   /f   他们的作用我在下面用例子解释<br>现在开始讲每个参数的意思。</p>
<h3 id="参数-d-主要搜索匹配目录"><a href="#参数-d-主要搜索匹配目录" class="headerlink" title="参数 /d (主要搜索匹配目录)"></a>参数 <code>/d</code> (主要搜索匹配目录)</h3><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /D <span class="variable">%%v</span>ariable <span class="keyword">IN</span> (<span class="built_in">set</span>) <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line">    如果集中包含通配符，则指定与目录名匹配，而不与文件</span><br><span class="line">    名匹配。</span><br></pre></td></tr></table></figure>
<p>如果 Set (也就是我上面写的 “相关文件或命令”) 包含通配符 <code>*</code> 和 <code>?</code>，将对与 Set 相匹配的每个目录（而不是指定目录中的文件组）执行指定的 Command。</p>
<p>这个参数主要用于目录搜索,不会搜索文件,看这样的例子<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /d <span class="variable">%%i</span> <span class="keyword">in</span> (c:\*) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行会把C盘根目录下的全部目录名字打印出来,而文件名字一个也不显示!</p>
<p>在来一个,比如我们要把当前路径下文件夹的名字只有1-3个字母的打出来<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /d <span class="variable">%%i</span> <span class="keyword">in</span> (???) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>这样的话如果你当前目录下有目录名字只有1-3个字母的,就会显示出来,没有就不显示了</p>
<p>这里解释下<code>*</code>号和<code>?</code>号的作用,<code>*</code>号表示任意N个字符,而<code>?</code>号只表示任意一个字符</p>
<p>知道作用了,给大家个思考题目!<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /d <span class="variable">%%i</span> <span class="keyword">in</span> (window?) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>保存到C盘下执行,会显示什么呢?自己看吧! 显示：windows<br>/D参数只能显示当前目录下的目录名字,这个大家要注意!</p>
<h3 id="参数-R-（搜索指定目录树中的匹配文件）"><a href="#参数-R-（搜索指定目录树中的匹配文件）" class="headerlink" title="参数 /R （搜索指定目录树中的匹配文件）"></a>参数 <code>/R</code> （搜索指定目录树中的匹配文件）</h3><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /R [[drive:]<span class="built_in">path</span>] <span class="variable">%%v</span>ariable <span class="keyword">IN</span> (<span class="built_in">set</span>) <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"></span><br><span class="line">    检查以 [drive:]<span class="built_in">path</span> 为根的目录树，指向每个目录中的</span><br><span class="line">    <span class="keyword">FOR</span> 语句。如果在 /R 后没有指定目录，则使用当前</span><br></pre></td></tr></table></figure>
<p>目录。如果集仅为一个单点(.)字符，则枚举该目录树。</p>
<p>递归</p>
<p>上面我们知道,/D只能显示当前路径下的目录名字,那么现在这个/R也是和目录有关,他能干嘛呢?放心他比/D强大多了!<br>他可以把当前或者你指定路径下的文件名字全部读取,注意是文件名字,有什么用看例子!</p>
<p><strong>请注意2点：</strong></p>
<ol>
<li><p>set中的文件名如果含有通配符(？或*)，则列举/R参数指定的目录及其下面的所用子目录中与set相符合的所有文件，无相符文件的目录则不列举。如果目录树中没有相符的文件，或者指定的目录根本不存在，这两种情况下均不会列举目录。</p>
</li>
<li><p>相反，如果set中为具体文件名（即不含通配符?和*)，则枚举该目录树（即列举该目录及其下面的所有子目录），而不管set中的指定文件是否存在，也就是说，此时不但列举含有指定文件的目录，也要列举不含指定文件的其它所有目录。这与前面所说的单点（.）枚举目录树是一个道理，单点代表当前目录，也可视为一个文件。此时哪怕指定的目录根本不存在，同样会列举目录。<br>比如：<br><code>for /r M:\不存在 %%i in (1.exe) do echo %%i</code><br>运行显示：<code>M:\不存在\1.exe</code></p>
</li>
</ol>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /r c:\ <span class="variable">%%i</span> <span class="keyword">in</span> (*.exe) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>咱们把这个BAT保存到D盘随便哪里然后执行,我会就会看到,他把C盘根目录,和每个目录的子目录下面全部的EXE文件都列出来了!!!!没有exe文件的目录则不列举。</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /r <span class="variable">%%i</span> <span class="keyword">in</span> (*.exe) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>参数不一样了吧!这个命令前面没加那个<code>C:\</code>也就是搜索路径,这样他就会以当前目录为搜索路径,比如你这个BAT你把他放在<code>d:\test</code>目录下执行,那么他就会把<code>D:\test</code>目录和他下面的子目录的全部EXE文件列出来!!!</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /r c:\ <span class="variable">%%i</span> <span class="keyword">in</span> (boot.ini) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行本例发现枚举了c盘所有目录。</p>
<p>为了只列举boot.ini存在的目录，可改成下面这样：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /r c:\ <span class="variable">%%i</span> <span class="keyword">in</span> (boot.ini) <span class="keyword">do</span> <span class="keyword">if</span> <span class="keyword">exist</span> <span class="variable">%%i</span> <span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>用这条命令搜索文件真不错。。。。。。</p>
<p>这个参数大家应该理解了吧!还是满好玩的命令!</p>
<h3 id="参数-L-（按数字序列-start-step-end-循环）"><a href="#参数-L-（按数字序列-start-step-end-循环）" class="headerlink" title="参数 /L （按数字序列 start,step,end 循环）"></a>参数 <code>/L</code> （按数字序列 start,step,end 循环）</h3><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /L <span class="variable">%%v</span>ariable <span class="keyword">IN</span> (<span class="built_in">start</span>,step,end) <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"></span><br><span class="line">    该集表示以增量形式从开始到结束的一个数字序列。</span><br><span class="line">    因此，(<span class="number">1</span>,<span class="number">1</span>,<span class="number">5</span>) 将产生序列 <span class="number">1</span> <span class="number">2</span> <span class="number">3</span> <span class="number">4</span> <span class="number">5</span>，(<span class="number">5</span>,-<span class="number">1</span>,<span class="number">1</span>) 将产生</span><br><span class="line">    序列 (<span class="number">5</span> <span class="number">4</span> <span class="number">3</span> <span class="number">2</span> <span class="number">1</span>)。</span><br></pre></td></tr></table></figure>
<p>使用迭代变量设置起始值 (Start#)，然后逐步执行一组范围的值，直到该值超过所设置的终止值 (End#)。/L 将通过对 Start# 与 End# 进行比较来执行迭代变量。如果 Start# 小于 End#，就会执行该命令。如果迭代变量超过 End#，则命令解释程序退出此循环。还可以使用负的 Step# 以递减数值的方式逐步执行此范围内的值。例如，(1,1,5) 生成序列 1 2 3 4 5，而 (5,-1,1) 则生成序列 (5 4 3 2 1)。语法是：</p>
<p>看着这说明有点晕吧!咱们看例子就不晕了!<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /l <span class="variable">%%i</span> <span class="keyword">in</span> (<span class="number">1</span>,<span class="number">1</span>,<span class="number">5</span>) <span class="keyword">do</span> @<span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>保存执行看效果,他会打印从1 2 3 4 5  这样5个数字<br>(1,1,5)这个参数也就是表示从1开始每次加1直到5终止!</p>
<p>等会晕,就打印个数字有P用…好的满足大家,看这个例子<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">for</span> /l <span class="variable">%%i</span> <span class="keyword">in</span> (<span class="number">1</span>,<span class="number">1</span>,<span class="number">5</span>) <span class="keyword">do</span> <span class="built_in">start</span> <span class="built_in">cmd</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>执行后是不是吓了一跳,怎么多了5个CMD窗口,呵呵!如果把那个 (1,1,5)改成 (1,1,65535)会有什么结果,我先告诉大家,会打开65535个CMD窗口….这么多你不死机算你强!<br>当然我们也可以把那个start cmd改成md %%i 这样就会建立指定个目录了!!!名字为1-65535</p>
<p>看完这个被我赋予破坏性质的参数后,我们来看最后一个参数</p>
<h3 id="参数-F-（处理-命令输出，字符串及文件内容）"><a href="#参数-F-（处理-命令输出，字符串及文件内容）" class="headerlink" title="参数 /F （处理 命令输出，字符串及文件内容）"></a>参数 <code>/F</code> （处理 命令输出，字符串及文件内容）</h3><p>迭代及文件解析<br>使用文件解析来处理命令输出. 字符串及文件内容。使用迭代变量定义要检查的内容或字符串，并使用各种options选项进一步修改解析方式。使用options令牌选项指定哪些令牌应该作为迭代变量传递。请注意：在没有使用令牌选项时，/F 将只检查第一个令牌。<br>文件解析过程包括读取输出. 字符串或文件内容，将其分成独立的文本行以及再将每行解析成零个或更多个令牌。然后通过设置为令牌的迭代变量值，调用 for 循环。默认情况下，/F 传递每个文件每一行的第一个空白分隔符号。跳过空行。</p>
<p>详细的帮助格式为：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F ["options"] <span class="variable">%%v</span>ariable <span class="keyword">IN</span> (file-<span class="built_in">set</span>) <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"><span class="keyword">FOR</span> /F ["options"] <span class="variable">%%v</span>ariable <span class="keyword">IN</span> ("string") <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"><span class="keyword">FOR</span> /F ["options"] <span class="variable">%%v</span>ariable <span class="keyword">IN</span> ('command') <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"></span><br><span class="line">    带引号的字符串"options"包括一个或多个</span><br><span class="line">    指定不同解析选项的关键字。这些关键字为:</span><br><span class="line"></span><br><span class="line">        eol=c           - 指一个行注释字符的结尾(就一个)</span><br><span class="line">        skip=n          - 指在文件开始时忽略的行数。</span><br><span class="line">        delims=xxx      - 指分隔符集。这个替换了空格和跳格键的</span><br><span class="line">                          默认分隔符集。</span><br><span class="line">        tokens=x,y,m-n  - 指每行的哪一个符号被传递到每个迭代</span><br><span class="line">                          的 <span class="keyword">for</span> 本身。这会导致额外变量名称的分配。m-n</span><br><span class="line">                          格式为一个范围。通过 nth 符号指定 mth。如果</span><br><span class="line">                          符号字符串中的最后一个字符星号，</span><br><span class="line">                          那么额外的变量将在最后一个符号解析之后</span><br><span class="line">                          分配并接受行的保留文本。经测试，该参数最多</span><br><span class="line">                          只能区分<span class="number">31</span>个字段。</span><br><span class="line"></span><br><span class="line">        usebackq        - 使用后引号（键盘上数字<span class="number">1</span>左面的那个键`）。</span><br><span class="line"></span><br><span class="line">                        未使用参数usebackq时：file-<span class="built_in">set</span>表示文件，但不能含有空格</span><br><span class="line">                            双引号表示字符串，即"string"</span><br><span class="line">                            单引号表示执行命令，即'command'</span><br><span class="line"></span><br><span class="line">                          使用参数usebackq时：file-<span class="built_in">set</span>和"file-<span class="built_in">set</span>"都表示文件</span><br><span class="line">                          当文件路径或名称中有空格时，就可以用双引号括起来</span><br><span class="line">                            单引号表示字符串，即'string'</span><br><span class="line">                            后引号表示命令执行，即`command`</span><br></pre></td></tr></table></figure></p>
<p>以上是用<code>for /?</code>命令获得的帮助信息，直接复制过来的。<br>晕惨了!我这就举个例子帮助大家来理解这些参数!</p>
<p>For命令例1：<strong><strong><strong><strong><strong><strong><strong><strong><strong><em>**</em></strong></strong></strong></strong></strong></strong></strong></strong></strong><br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="comment">rem 首先建立临时文件test.txt</span></span><br><span class="line"><span class="built_in">echo</span> ;注释行,这是临时文件,用完删除 &gt;test.txt</span><br><span class="line"><span class="built_in">echo</span> <span class="number">11</span>段 <span class="number">12</span>段 <span class="number">13</span>段 <span class="number">14</span>段 <span class="number">15</span>段 <span class="number">16</span>段 &gt;&gt;test.txt</span><br><span class="line"><span class="built_in">echo</span> <span class="number">21</span>段,<span class="number">22</span>段,<span class="number">23</span>段,<span class="number">24</span>段,<span class="number">25</span>段,<span class="number">26</span>段 &gt;&gt;test.txt</span><br><span class="line"><span class="built_in">echo</span> <span class="number">31</span>段-<span class="number">32</span>段-<span class="number">33</span>段-<span class="number">34</span>段-<span class="number">35</span>段-<span class="number">36</span>段 &gt;&gt;test.txt</span><br><span class="line"><span class="keyword">FOR</span> /F "eol=; tokens=<span class="number">1</span>,<span class="number">3</span>* delims=,- " <span class="variable">%%i</span> <span class="keyword">in</span> (test.txt) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span> <span class="variable">%%j</span> <span class="variable">%%k</span></span><br><span class="line"><span class="built_in">Pause</span></span><br><span class="line"><span class="built_in">Del</span> test.txt</span><br></pre></td></tr></table></figure></p>
<p>运行显示结果：</p>
<p>11段 13段 14段 15段 16段<br>21段 23段 24段,25段,26段<br>31段 33段 34段-35段-36段<br>请按任意键继续. . .</p>
<p>为什么会这样?我来解释：<br>eol=;          分号开头的行为注释行<br>tokens=1,3*    将每行第1段,第3段和剩余字段分别赋予变量%%i，%%j，%%k<br>delims=,-     （减号后有一空格）以逗号减号和空格为分隔符，空格必须放在最后</p>
<p>For命令例2：<strong><strong><strong><strong><strong><strong><strong><strong><strong><em>**</em></strong></strong></strong></strong></strong></strong></strong></strong></strong><br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">FOR</span> /F "eol= delims=" <span class="variable">%%i</span> <span class="keyword">in</span> (test.txt) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">Pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行将显示test.txt全部内容，包括注释行，不解释了哈。</p>
<p>For命令例3：<strong><strong><strong><strong><strong><strong><strong><strong><strong><em>**</em></strong></strong></strong></strong></strong></strong></strong></strong></strong></p>
<p>另外/F参数还可以以输出命令的结果看这个例子<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">FOR</span> /F "delims=" <span class="variable">%%i</span> <span class="keyword">in</span> ('<span class="built_in">net</span> user') <span class="keyword">do</span> @<span class="built_in">echo</span> <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>这样你本机全部帐号名字就出来了把扩号内的内容用两个单引号引起来就表示那个当命令执行,FOR会返回命令的每行结果,加那个”delims=” 是为了让我空格的行能整行显示出来,不加就只显示空格左边一列!</p>
<p>基本上讲完了FOR的基本用法了…如果你看过FOR的系统帮助,你会发现他下面还有一些特定义的变量,这些我先不讲.大家因该都累了吧!你不累我累啊….</p>
<p>所谓文武之道，一张一弛，现休息一下。</p>
<h2 id="第三章-FOR命令中的变量"><a href="#第三章-FOR命令中的变量" class="headerlink" title="第三章 FOR命令中的变量"></a>第三章 FOR命令中的变量</h2><p>FOR命令中有一些变量,他们的用法许多新手朋友还不太了解,今天给大家讲解他们的用法!</p>
<p>先把FOR的变量全部列出来：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">~I          - 删除任何引号(")，扩展 %I</span><br><span class="line">%~fI        - 将 %I 扩展到一个完全合格的路径名</span><br><span class="line">%~dI        - 仅将 %I 扩展到一个驱动器号</span><br><span class="line">%~pI        - 仅将 %I 扩展到一个路径</span><br><span class="line">%~nI        - 仅将 %I 扩展到一个文件名</span><br><span class="line">%~xI        - 仅将 %I 扩展到一个文件扩展名</span><br><span class="line">%~sI        - 扩展的路径只含有短名</span><br><span class="line">%~aI        - 将 %I 扩展到文件的文件属性</span><br><span class="line">%~tI        - 将 %I 扩展到文件的日期/时间</span><br><span class="line">%~zI        - 将 %I 扩展到文件的大小</span><br><span class="line">%~$<span class="built_in">PATH</span>:I   - 查找列在路径环境变量的目录，并将 %I 扩展</span><br><span class="line">              到找到的第一个完全合格的名称。如果环境变量名</span><br><span class="line">              未被定义，或者没有找到文件，此组合键会扩展到</span><br><span class="line">              空字符串</span><br></pre></td></tr></table></figure></p>
<p>我们可以看到每行都有一个大写字母”I”,这个I其实就是我们在FOR带入的变量,我们FOR语句代入的变量名是什么,这里就写什么.<br>比如<code>:FOR /F  %%z IN (&#39;set&#39;) DO @echo %%z</code><br>这里我们代入的变量名是z那么我们就要把那个I改成z,例如%~fI改为%~fz<br>至于前面的%~p这样的内容就是语法了!</p>
<p>好开始讲解:</p>
<h3 id="I-删除任何引号-“-，扩展-I"><a href="#I-删除任何引号-“-，扩展-I" class="headerlink" title="~I 删除任何引号(“)，扩展 %I"></a><code>~I</code> 删除任何引号(“)，扩展 <code>%I</code></h3><p>这个变量的作用就如他的说明,删除引号!<br>我们来看这个例子：<br>首先建立临时文件temp.txt，内容如下<br>“1111<br>“2222”<br>3333”<br>“4444”44<br>“55”55”55</p>
<p>可建立个BAT文件代码如下：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> ^"<span class="number">1111</span>&gt;temp.txt</span><br><span class="line"><span class="built_in">echo</span> "<span class="number">2222</span>"&gt;&gt;temp.txt</span><br><span class="line"><span class="built_in">echo</span> <span class="number">3333</span>^"&gt;&gt;temp.txt</span><br><span class="line"><span class="built_in">echo</span> "<span class="number">4444</span>"<span class="number">44</span>&gt;&gt;temp.txt</span><br><span class="line"><span class="built_in">echo</span> ^"<span class="number">55</span>"<span class="number">55</span>"<span class="number">55</span>&gt;&gt;temp.txt</span><br><span class="line"><span class="comment">rem 上面建立临时文件，注意不成对的引号要加转义字符^，重定向符号前不要留空格</span></span><br><span class="line"><span class="keyword">FOR</span> /F "delims=" <span class="variable">%%i</span> <span class="keyword">IN</span> (temp.txt) <span class="keyword">DO</span> <span class="built_in">echo</span>  <span class="variable">%%~</span>i</span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"><span class="built_in">del</span> temp.txt</span><br></pre></td></tr></table></figure></p>
<p>执行后,我们看CMD的回显如下：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1111</span>           #字符串前的引号被删除了</span><br><span class="line"><span class="number">2222</span>           #字符串首尾的引号都被删除了</span><br><span class="line"><span class="number">3333</span>"          #字符串前无引号，后面的引号保留</span><br><span class="line"><span class="number">4444</span>"<span class="number">44</span>        #字符串前面的引号删除了，而中间的引号保留</span><br><span class="line"><span class="number">55</span>"<span class="number">55</span>"<span class="number">55</span>       #字符串前面的引号删除了，而中间的引号保留</span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<p>和之前temp.txt中的内容对比一下,我们会发现第1. 2. 5行的引号都消失了,这就是删除引号~i的作用了!<br>删除引号规则如下(BAT兄补充!)</p>
<ol>
<li>若字符串首尾同时存在引号，则删除首尾的引号；</li>
<li>若字符串尾不存在引号，则删除字符串首的引号；</li>
<li>如果字符串中间存在引号，或者只在尾部存在引号，则不删除。</li>
</ol>
<p>龙卷风补充：无头不删，有头连尾删。</p>
<h3 id="fI-将-I-扩展到一个完全合格的路径名"><a href="#fI-将-I-扩展到一个完全合格的路径名" class="headerlink" title="%~fI 将 %I 扩展到一个完全合格的路径名"></a><code>%~fI</code> 将 <code>%I</code> 扩展到一个完全合格的路径名</h3><p>看例子：<br>把代码保存放在随便哪个地方,我这里就放桌面吧.<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>fi</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>执行后显示内容如下<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">C:\<span class="title">Documents</span> <span class="title">and</span> <span class="title">Settings</span>\<span class="title">Administrator</span>\桌面\<span class="title">test.bat</span></span></span><br><span class="line"><span class="function"><span class="title">C</span>:\<span class="title">Documents</span> <span class="title">and</span> <span class="title">Settings</span>\<span class="title">Administrator</span>\桌面\<span class="title">test.vbs</span></span></span><br></pre></td></tr></table></figure></p>
<p>当我把代码中的 %%~fi直接改成%%i<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%i</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>执行后就会显示以下内容：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">test.bat</span><br><span class="line">test.vbs</span><br></pre></td></tr></table></figure></p>
<p>通过对比,我们很容易就看出没有路径了,这就是”将 %I 扩展到一个完全合格的路径名”的作用<br>也就是如果%i变量的内容是一个文件名的话,他就会把这个文件所在的绝对路径打印出来,而不只单单打印一个文件名,自己动手动实验下就知道了!</p>
<h3 id="dI-仅将-I-扩展到一个驱动器号"><a href="#dI-仅将-I-扩展到一个驱动器号" class="headerlink" title="%~dI 仅将 %I 扩展到一个驱动器号"></a><code>%~dI</code> 仅将 <code>%I</code> 扩展到一个驱动器号</h3><p>看例子：<br>代码如下,我还是放到桌面执行!<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>di</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>执行后我CMD里显示如下<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">C:</span></span><br><span class="line"><span class="function"><span class="title">C</span>:</span></span><br></pre></td></tr></table></figure></p>
<p>我桌面就两个文件test.bat,test.vbs,%%~di作用是,如果变量%%i的内容是一个文件或者目录名,他就会把他这文件<br>或者目录所在的盘符号打印出来!</p>
<h3 id="pI-仅将-I-扩展到一个路径"><a href="#pI-仅将-I-扩展到一个路径" class="headerlink" title="%~pI 仅将 %I 扩展到一个路径"></a><code>%~pI</code> 仅将 <code>%I</code> 扩展到一个路径</h3><p>这个用法和上面一样,他只打印路径不打印文件名字<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>pi</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>我就不打结果了,大家自己复制代码看结果吧,下面几个都是这么个用法,代码给出来,大家自己看结果吧!</p>
<h3 id="nI-仅将-I-扩展到一个文件名"><a href="#nI-仅将-I-扩展到一个文件名" class="headerlink" title="%~nI 仅将 %I 扩展到一个文件名"></a><code>%~nI</code> 仅将 <code>%I</code> 扩展到一个文件名</h3><p>只打印文件名字<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>ni</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="xI-仅将-I-扩展到一个文件扩展名"><a href="#xI-仅将-I-扩展到一个文件扩展名" class="headerlink" title="%~xI 仅将 %I 扩展到一个文件扩展名"></a><code>%~xI</code> 仅将 <code>%I</code> 扩展到一个文件扩展名</h3><p>只打印文件的扩展名<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>xi</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="sI-扩展的路径只含有短名"><a href="#sI-扩展的路径只含有短名" class="headerlink" title="%~sI 扩展的路径只含有短名"></a><code>%~sI</code> 扩展的路径只含有短名</h3><p>打印绝对短文件名<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>si</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="aI-将-I-扩展到文件的文件属性"><a href="#aI-将-I-扩展到文件的文件属性" class="headerlink" title="%~aI 将 %I 扩展到文件的文件属性"></a><code>%~aI</code> 将 <code>%I</code> 扩展到文件的文件属性</h3><p>打印文件的属性<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>ai</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="tI-将-I-扩展到文件的日期-时间"><a href="#tI-将-I-扩展到文件的日期-时间" class="headerlink" title="%~tI 将 %I 扩展到文件的日期/时间"></a><code>%~tI</code> 将 <code>%I</code> 扩展到文件的日期/时间</h3><p>打印文件建立的日期<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>ti</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="zI-将-I-扩展到文件的大小"><a href="#zI-将-I-扩展到文件的大小" class="headerlink" title="%~zI 将 %I 扩展到文件的大小"></a><code>%~zI</code> 将 <code>%I</code> 扩展到文件的大小</h3><p>打印文件的大小<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /F "delims==" <span class="variable">%%i</span> <span class="keyword">IN</span> ('<span class="built_in">dir</span> /b') <span class="keyword">DO</span> @<span class="built_in">echo</span>  <span class="variable">%%~</span>zi</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>上面例子中的”delims==”可以改为”delims=”，即不要分隔符</p>
<h3 id="PATH-I"><a href="#PATH-I" class="headerlink" title="%~$PATH:I"></a><code>%~$PATH:I</code></h3><p>查找列在路径环境变量的目录，并将 %I 扩展到找到的第一个完全合格的名称。如果环境变量名未被定义，或者没有找到文件，此组合键会扩展到 空字符串<br>这是最后一个,和上面那些都不一样,我单独说说!</p>
<p>然后在把这些代码保存为批处理,放在桌面。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">FOR</span> /F "delims=" <span class="variable">%%i</span> <span class="keyword">IN</span> (“notepad.exe”) <span class="keyword">DO</span> <span class="built_in">echo</span>  <span class="variable">%%~</span>$<span class="built_in">PATH</span>:i</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>龙卷风补充：上面代码显示结果为<code>C:\WINDOWS\system32\notepad.exe</code></p>
<p>他的意思就在PATH变量里指定的路径里搜索notepad.exe文件，如果有notepad.exe则会把他所在绝对路径打印出来，没有就打印一个错误！</p>
<p>好了,FOR的的变量就介绍到这了!</p>
<h2 id="第四章-批处理中的变量"><a href="#第四章-批处理中的变量" class="headerlink" title="第四章 批处理中的变量"></a>第四章 批处理中的变量</h2><p>批处理中的变量,我把他分为两类,分别为”系统变量”和”自定义变量”</p>
<p>我们现在来详解这两个变量!</p>
<h3 id="一-系统变量"><a href="#一-系统变量" class="headerlink" title="一. 系统变量"></a>一. 系统变量</h3><p>他们的值由系统将其根据事先定义的条件自动赋值,也就是这些变量系统已经给他们定义了值,<br>不需要我们来给他赋值,我们只需要调用而以!  我把他们全部列出来!</p>
<p>%ALLUSERSPROFILE% 本地 返回“所有用户”配置文件的位置。<br>%APPDATA% 本地 返回默认情况下应用程序存储数据的位置。<br>%CD% 本地 返回当前目录字符串。<br>%CMDCMDLINE% 本地 返回用来启动当前的 Cmd.exe 的准确命令行。<br>%CMDEXTVERSION% 系统 返回当前的“命令处理程序扩展”的版本号。<br>%COMPUTERNAME%  系统 返回计算机的名称。<br>%COMSPEC%  系统 返回命令行解释器可执行程序的准确路径。<br>%DATE%  系统 返回当前日期。使用与 date /t 命令相同的格式。由 Cmd.exe 生成。有关</p>
<p>date 命令的详细信息，请参阅 Date。<br>%ERRORLEVEL%  系统 返回上一条命令的错误代码。通常用非零值表示错误。<br>%HOMEDRIVE%  系统 返回连接到用户主目录的本地工作站驱动器号。基于主目录值而设置。用</p>
<p>户主目录是在“本地用户和组”中指定的。<br>%HOMEPATH%  系统 返回用户主目录的完整路径。基于主目录值而设置。用户主目录是在“本地用户和组”中指定的。</p>
<p>%HOMESHARE%  系统 返回用户的共享主目录的网络路径。基于主目录值而设置。用户主目录是</p>
<p>在“本地用户和组”中指定的。<br>%LOGONSERVER%  本地 返回验证当前登录会话的域控制器的名称。<br>%NUMBER_OF_PROCESSORS%  系统 指定安装在计算机上的处理器的数目。<br>%OS%  系统 返回操作系统名称。Windows 2000 显示其操作系统为 Windows_NT。<br>%PATH% 系统 指定可执行文件的搜索路径。<br>%PATHEXT% 系统 返回操作系统认为可执行的文件扩展名的列表。<br>%PROCESSOR_ARCHITECTURE%  系统 返回处理器的芯片体系结构。值：x86 或 IA64 基于</p>
<p>Itanium<br>%PROCESSOR_IDENTFIER% 系统 返回处理器说明。<br>%PROCESSOR_LEVEL%  系统 返回计算机上安装的处理器的型号。<br>%PROCESSOR_REVISION% 系统 返回处理器的版本号。<br>%PROMPT% 本地 返回当前解释程序的命令提示符设置。由 Cmd.exe 生成。<br>%RANDOM% 系统 返回 0 到 32767 之间的任意十进制数字。由 Cmd.exe 生成。<br>%SYSTEMDRIVE% 系统 返回包含 Windows server operating system 根目录（即系统根目录）</p>
<p>的驱动器。<br>%SYSTEMROOT%  系统 返回 Windows server operating system 根目录的位置。<br>%TEMP% 和 %TMP% 系统和用户 返回对当前登录用户可用的应用程序所使用的默认临时目录。</p>
<p>有些应用程序需要 TEMP，而其他应用程序则需要 TMP。<br>%TIME% 系统 返回当前时间。使用与 time /t 命令相同的格式。由 Cmd.exe 生成。有关</p>
<p>time 命令的详细信息，请参阅 Time。<br>%USERDOMAIN% 本地 返回包含用户帐户的域的名称。<br>%USERNAME% 本地 返回当前登录的用户的名称。<br>%USERPROFILE% 本地 返回当前用户的配置文件的位置。<br>%WINDIR% 系统 返回操作系统目录的位置。</p>
<p>这么多系统变量,我们如何知道他的值是什么呢?<br>在CMD里输入  echo %WINDIR%<br>这样就能显示一个变量的值了!</p>
<p>举个实际例子,比如我们要复制文件到当前帐号的启动目录里就可以这样<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">copy</span> d:\<span class="number">1</span>.bat "<span class="variable">%USERPROFILE%</span>\「开始」菜单\程序\启动\"</span><br></pre></td></tr></table></figure></p>
<p>%USERNAME% 本地 返回当前登录的用户的名称。  注意有空格的目录要用引号引起来</p>
<p>另外还有一些系统变量,他们是代表一个意思,或者一个操作!</p>
<p>他们分别是%0 %1 %2 %3 %4 %5 ……一直到%9 还有一个%*</p>
<p>%0 这个有点特殊,有几层意思,先讲%1-%9的意思.</p>
<p>%1 返回批处理的第一个参数<br>%2 返回批处理的第二个参数<br>%3-%9依此推类</p>
<p>反回批处理参数?到底怎么个返回法?</p>
<p>我们看这个例子,把下面的代码保存为test.BAT然后放到C盘下<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> %<span class="number">1</span> %<span class="number">2</span> %<span class="number">3</span> %<span class="number">4</span></span><br><span class="line"><span class="built_in">echo</span> %<span class="number">1</span></span><br><span class="line"><span class="built_in">echo</span> %<span class="number">2</span></span><br><span class="line"><span class="built_in">echo</span> %<span class="number">3</span></span><br><span class="line"><span class="built_in">echo</span> %<span class="number">4</span></span><br></pre></td></tr></table></figure></p>
<p>进入CMD,输入<code>cd c:\</code><br>然后输入 test.bat 我是第一个参数 我是第二个参数  我是第三个参数  我是第四个参数</p>
<p>注意中间的空格,我们会看到这样的结果：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">我是第一个参数 我是第二个参数 我是第三个参数 我是第四个参数</span><br><span class="line">我是第一个参数</span><br><span class="line">我是第二个参数</span><br><span class="line">我是第三个参数</span><br><span class="line">我是第四个参数</span><br></pre></td></tr></table></figure></p>
<p>对比下代码,%1就是”我是第一个参数”  %2就是”我是第二个参数”<br>怎么样理解了吧!</p>
<p>这些%1和%9可以让批处理也能带参数运行,大大提高批处理功能!</p>
<p>还有一个%*  他是什么呢?他的作用不是很大,只是返回参数而已,不过他是一次返回全部参数的值,不用在输入%1 %2来确定一个个的</p>
<p>例子<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> %*</span><br></pre></td></tr></table></figure></p>
<p>同样保存为test.bat 放到C盘<br>进入CMD,输入<code>cd c:\</code><br>然后输入 test.bat 我是第一个参数 我是第二个参数  我是第三个参数  我是第四个参数</p>
<p>可以看到他一次把全部参数都显示出来了</p>
<p>好现在开始讲那个比较特殊的%0</p>
<p>%0  这个不是返回参数的值了,他有两层意思!</p>
<p>第一层意思：返回批处理所在绝对路径</p>
<p>例子：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> %<span class="number">0</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>保存为test.BAT放在桌面运行,会显示如下结果<br><code>C:\Documents and Settings\Administrator\桌面\test.bat</code></p>
<p>他把当前批处理执行的所在路经打印出来了,这就是返回批处理所在绝对路径的意思</p>
<p>第二层意思：无限循环执行BAT</p>
<p>例子：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">net</span> user</span><br><span class="line">%<span class="number">0</span></span><br></pre></td></tr></table></figure></p>
<p>保存为BAT执行,他就会无限循环执行net user这条命令,直到你手动停止.<br>龙卷风补充：其实%0就是第一参数%1前面那个参数，当然就是批处理文件名（包括路径）。</p>
<p>以上就是批处理中的一些系统变量,另外还有一些变量,他们也表示一些功能,<br>FOR命令中的那些就是,FOR变量已经说过,就不讲了.</p>
<h3 id="二-自定义变量"><a href="#二-自定义变量" class="headerlink" title="二. 自定义变量"></a>二. 自定义变量</h3><p>故名思意,自定义变量就是由我们来给他赋予值的变量</p>
<p>要使用自定义变量就得使用set命令了,看例子.<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> var=我是值</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>保存为BAT执行,我们会看到CMD里返回一个  “我是值”</p>
<p>var为变量名,=号右变的是要给变量的值<br>这就是最简单的一种设置变量的方法了</p>
<p>如果我们想让用户手工输入变量的值,而不是在代码里指定,可以用用set命令的/p参数</p>
<p>例子：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p var=请输入变量的值</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>var变量名  =号右边的是提示语,不是变量的值<br>变量的值由我们运行后自己用键盘输入!</p>
<p>好了批处理的变量先介绍到这,关于set命令,下次再写个专门的文章吧.</p>
<h2 id="第五章-set命令详解"><a href="#第五章-set命令详解" class="headerlink" title="第五章 set命令详解"></a>第五章 set命令详解</h2><p>很久没发贴了,今天来写点讲BAT的新手教学贴!</p>
<p>在上一贴中我简单的介绍了一下SET设置自定义变量的作用,现在我来具体讲一下set的其他功能.</p>
<h3 id="一-用set命令设置自定义变量"><a href="#一-用set命令设置自定义变量" class="headerlink" title="一. 用set命令设置自定义变量"></a>一. 用set命令设置自定义变量</h3><p>显示、设置或删除 cmd.exe 环境变量。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">SET</span> [variable=[string]]</span><br><span class="line">  variable  指定环境变量名。</span><br><span class="line">  string    指定要指派给变量的一系列字符串。</span><br></pre></td></tr></table></figure></p>
<p>要显示当前环境变量，键入不带参数的 SET。<br>SET 命令不允许变量名含有等号。</p>
<p>注意：以下用法将清除变量variable的值，使其变成未定义状态。<br>SET variable=<br>上面等号后面无任何符号，如果写成SET variable=””，此时变量值并不为空，而是等于两个引号，即””</p>
<p>例子：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> var=我是值</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>请看 set var=我是值 ,这就是BAT直接在批处理中设置变量的方法!<br>set 是命令   var是变量名  =号右边的”我是值”是变量的值<br>在批处理中我们要引用这个变就把var变量名用两个%(百分号)扩起来,如%var%</p>
<p>SET还可以提供一个交互界面,让用户自己输入变量的值,然后我们在来根据这个值来做相应操作,现在我就来说说SET的这种语法,只需要加一个”/P”参数就可以了!<br>SET /P variable=[promptString]</p>
<p>例子：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p var=请输入变量的值:</span><br><span class="line"><span class="built_in">echo</span> 您输入了 <span class="variable">%var%</span>  ~_~</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>set /p 是命令语法  var是变量名    =号右边的”请输入变量的值: “,这个是提示语,不是变量的值了!<br>运行后,我们在提示语后面直接输入1,就会显示一行您输入了 1 ~_~</p>
<p>好了,先回顾到这,现在讲SET其他功能</p>
<p>使用<code>set /?</code>查看SET的帮助我们发现SET除了我上面讲的<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">SET</span> [variable=[string]]</span><br><span class="line"><span class="built_in">SET</span> /P variable=[promptString]</span><br></pre></td></tr></table></figure></p>
<p>这两种语法外,还有如下几种语法：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">SET</span> /A expression</span><br></pre></td></tr></table></figure></p>
<p>环境变量替换已如下增强：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">%PATH:str1=str2%</span></span><br><span class="line"><span class="variable">%PATH:~10,5%</span></span><br><span class="line"><span class="variable">%PATH:~-10%</span></span><br><span class="line"><span class="variable">%PATH:~0,-2%</span></span><br></pre></td></tr></table></figure></p>
<p>这机种语法有什么用处呢?下面我们来一个个讲解他们!</p>
<h3 id="二-用set命令进行简单计算"><a href="#二-用set命令进行简单计算" class="headerlink" title="二. 用set命令进行简单计算"></a>二. 用set命令进行简单计算</h3><p>语法：SET /A expression<br>/A 命令行开关指定等号右边的字符串为被评估的数字表达式。该表达式<br>评估器很简单并以递减的优先权顺序支持下列操作：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">()                  -分组</span><br><span class="line">! ~ -               -一元运算符</span><br><span class="line">* / %               -算数运算符</span><br><span class="line">+ -                 -算数运算符</span><br><span class="line">&lt;&lt; &gt;&gt;               -二进制逻辑移位</span><br><span class="line">&amp;                   -二进制按位“与”</span><br><span class="line">^                   -二进制按位“异”</span><br><span class="line">|                   -二进制按位“或”</span><br><span class="line">= *= /= %= += -=    -算数赋值</span><br><span class="line">&amp;= ^= |= &lt;&lt;= &gt;&gt;=    -二进制运算赋值</span><br><span class="line">,                   -表达式分隔符</span><br></pre></td></tr></table></figure></p>
<p>如果 SET /A 在命令脚本外的命令行执行的，那么它显示该表达式的最后值。<br>除十六进制有 0x 前缀， 八进制有 0 前缀的，数字值为十进位数字。<br>因此， 0x12 与 18 和 022相同。请注意八进制公式可能很容易搞混：<br> 08 和 09 是无效的数字，因为 8 和 9 不是有效的八进制位数。</p>
<p>上面这些是系统帮助里的内容,看着是不是有点晕，没关系我来简单解释一下：<br>set的/A参数就是让SET可以支持数学符号进行加减等一些简单数学运算!</p>
<p>注意：一般的运算常为十进制运算，如果数字字符串最左边为0，将被认为是八进制，从而出错。比如，0812之类的数字不能参与十进制运算，转换方法为：10812-10000</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">set</span> aa=<span class="number">0812</span></span><br><span class="line"><span class="built_in">set</span> /a aa=<span class="number">1</span><span class="variable">%aa%</span>-<span class="number">10000</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%aa%</span></span><br></pre></td></tr></table></figure></p>
<p>结果为：812</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p input=请输入计算表达式：</span><br><span class="line"><span class="built_in">set</span> /a var=<span class="variable">%input%</span></span><br><span class="line"><span class="built_in">echo</span> 计算结果：<span class="variable">%input%</span>=<span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>上面的例子是龙卷风设计的，很好用哟，请看下面几个运算过程：<br>注意：DOS计算只能进行整数运算，精确到整数</p>
<p>请输入计算表达式：1+9+20+30-10<br>计算结果：1+9+20+30-10=50<br>请按任意键继续. . .</p>
<p>请输入计算表达式：10/3    #除法只能精确到整数<br>计算结果：10/3=3<br>请按任意键继续. . .</p>
<p>请输入计算表达式：-100+62  #负数<br>计算结果：-100+62=-38<br>请按任意键继续. . .</p>
<p>请输入计算表达式：100%3    ＃求余数<br>计算结果：100%3=1<br>请按任意键继续. . .<br>注意：以上的求余数运算符%在批处理程序中必须写成%%</p>
<p>请输入计算表达式：(25+75)<em>2/(15+5)   #括号<br>计算结果：(25+75)</em>2/(15+5)=10<br>请按任意键继续. . .</p>
<p>请输入计算表达式：1234567890<em>9876543210   #范围<br>无效数字。数字精确度限为 32 位。<br>计算结果：1234567890</em>9876543210=<br>请按任意键继续. . .</p>
<p>注意：上面的计算过程显示，DOS计算只能精确到32位，这个32位是指二进制32位，其中最高位为符号位（0为正，1为负），低位31位为数值。31个1换成十进制为2147483647，所以DOS计算的有效值范围是-2147483648至2147483647，超出该数值范围时计算出错，请看下面的计算过程：</p>
<p>请输入计算表达式：2147483647-1    #最大值减1，值有效<br>计算结果：2147483647-1=2147483646<br>请按任意键继续. . .</p>
<p>请输入计算表达式：2147483647+1    #最大值加1，出错，结果为最小值<br>计算结果：2147483647+1=-2147483648<br>请按任意键继续. . .</p>
<p>请输入计算表达式：-2147483648-1   #最小值减1，出错，结果为最大值<br>计算结果：-2147483648-1=2147483647<br>请按任意键继续. . .</p>
<p>运行<code>set /a a=1+1,b=2+1,c=3+1</code>后会显示一个4,但我们用<br>echo %a% %b% %c%后看结果,会发现其他数学运算也有效果!,这就是表达式分隔符<code>,</code>逗号的<br>作用!</p>
<p>有时候我们需要直接在原变量进行加减操作就可以用这种语法<br>set /a var+=1  这样的语法对应原始语法就是set /a var = %var% + 1<br>都是一样的结果,在原变量的值上在进行数学运算,不过这样写简单一点<br>再来一个：<br>set /a var*=2<br>其他都这么用,只要帮助里有这个语法!</p>
<p>另外还有一些用逻辑或取余操作符,这些符号,按照上面的使用方法会报错的</p>
<p>比如我们在CMD里输入set /a var=1 &amp; 1 “与运算”,他并不会显示为1,而是报错,<br>为什么?对于这样的”逻辑或取余操作符”,我们需要把他们用双引号引起来,也可以用转义字符^，看例子</p>
<p>set /a var= 1 “&amp;” 1 这样结果就显示出来了,其他逻辑或取余操作符用法<br>set /a var= 1 “+” 1 异运算<br>set /a var= 1 “%” 1  取模运算<br>set /a var= 3 “&lt;&lt;” 2 左移位运算， 3的二进制为11，左移2位为1100，换成十进制就是12，自行验证<br>set /a var= 4 “&gt;&gt;” 2右移位运算，4的二进制为100，右移动2位为1，结果为1</p>
<p>龙卷风补充：凡是按位计算均需换算成二进制。</p>
<p>思考题：求2的n次方<br>参考答案：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p n=请输入<span class="number">2</span>的几次方: </span><br><span class="line"><span class="built_in">set</span> /a num=<span class="number">1</span>^&lt;^&lt;n</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%num%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行结果：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">请输入<span class="number">2</span>的几次方: <span class="number">3</span></span><br><span class="line"><span class="number">8</span></span><br><span class="line">请按任意键继续. . .</span><br><span class="line"></span><br><span class="line">请输入<span class="number">2</span>的几次方: <span class="number">10</span></span><br><span class="line"><span class="number">1024</span></span><br><span class="line">请按任意键继续. . .</span><br><span class="line"></span><br><span class="line">请输入<span class="number">2</span>的几次方: <span class="number">15</span></span><br><span class="line"><span class="number">32768</span></span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<h3 id="三-用set命令进行字符串处理"><a href="#三-用set命令进行字符串处理" class="headerlink" title="三. 用set命令进行字符串处理"></a>三. 用set命令进行字符串处理</h3><h4 id="1-字符串替换"><a href="#1-字符串替换" class="headerlink" title="1. 字符串替换"></a>1. 字符串替换</h4><p>好了，符号说到这，现在说<code>%PATH:str1=str2%</code><br>上面语法的意思就是：将字符串变量%PATH%中的str1替换为str2<br>这个是替换变量值的内容,看例子<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a= bbs. verybat. cn</span><br><span class="line"><span class="built_in">echo</span> 替换前的值: "<span class="variable">%a%</span>"</span><br><span class="line"><span class="built_in">set</span> var=%a: =%</span><br><span class="line"><span class="built_in">echo</span> 替换后的值: "<span class="variable">%var%</span>"</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：（龙卷风添加）<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">替换前的值: " bbs. verybat. cn"</span><br><span class="line">替换后的值: "bbs.verybat.cn"</span><br></pre></td></tr></table></figure></p>
<p>对比一下,我们发现他把变量%a%的空格给替换掉了,从这个例子,我们就可以发现<br><code>%PATH:str1=str2%</code>这个操作就是把变量%PATH%的里的str1全部用str2替换</p>
<p>比如我们把上面的例子改成这样<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a=bbs.verybat.cn</span><br><span class="line"><span class="built_in">echo</span> 替换前的值: "<span class="variable">%a%</span>"</span><br><span class="line"><span class="built_in">set</span> var=<span class="variable">%a:.=伤脑筋%</span></span><br><span class="line"><span class="built_in">echo</span> 替换后的值: "<span class="variable">%var%</span>"</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">替换前的值: "bbs.verybat.cn"</span><br><span class="line">替换后的值: "bbs伤脑筋verybat伤脑筋cn"</span><br></pre></td></tr></table></figure></p>
<p>解释<code>set var=%a:.=伤脑筋%</code><br>set是命令 var是变量名字 a是要进行字符替换的变量的值,”.”为要替换的值, “伤脑筋”为替换后的值!<br>执行后就会把变量%a%里面的”.”全部替换为”伤脑筋”<br>这就是set的替换字符的很好的功能! 替换功能先讲到这，下面将字符串截取功能</p>
<p>请注意：字符串的替换和截取功能在引用变量的地方均可以，并不一定必须要有set命令<br>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a=bbs.verybat.cn</span><br><span class="line"><span class="built_in">echo</span> 替换前的值: "<span class="variable">%a%</span>"</span><br><span class="line"><span class="built_in">echo</span> 替换后的值: "<span class="variable">%a:.=伤脑筋%</span>"</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>此例在echo语句中就替换了字符串，效果一样。</p>
<h4 id="2-字符串截取"><a href="#2-字符串截取" class="headerlink" title="2. 字符串截取"></a>2. 字符串截取</h4><p>截取功能统一语法格式为：<code>%a:~[m[,n]]%</code></p>
<p>方括号表示可选，%为变量标识符，a为变量名，不可少，冒号用于分隔变量名和说明部分，符号～可以简单理解为“偏移”即可，m为偏移量（缺省为0），n为截取长度（缺省为全部）</p>
<p><code>%PATH:~10,5%</code>  这个什么意思,看例子：</p>
<p>截取功能例子1：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a=bbs.verybat.cn</span><br><span class="line"><span class="built_in">set</span> var=<span class="variable">%a:~1,2%</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>执行后,我们会发现只显示了”bs”两个字母,我们的变量%a%的值不是为bbs.verybat.cn吗？<br>怎么只显示了第2个字母和第3个字母”bs”,分析一结果我们就可以很容易看出<br><code>%a:~10,5%</code>就是显示变量a里从11位（偏移量10）开始的5个字符!<br>分析<code>set var=%a:~1,2%</code><br>set是命令，var是变量值，a要进行字符操作的变量，”1”从变量”a”第几位开始显示，”2”表示显示几位。<br>合起来就是把变量a的值从第2位（偏移量1）开始,把2个字符赋予给变量var<br>这样应该明白了吧~</p>
<p>其他两种语法<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">%PATH:~-10%</span></span><br><span class="line"><span class="variable">%PATH:~0,-2%</span></span><br></pre></td></tr></table></figure></p>
<p>他们也是显示指定变量指定几位的值的意思</p>
<p><code>%PATH:~-10%</code> 看例子</p>
<p>截取功能例子2：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a=bbs.verybat.cn</span><br><span class="line"><span class="built_in">set</span> var=<span class="variable">%a:~-3%</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行结果：.cn<br>这个就是把变量a倒数3位的值给变量VAR</p>
<p>当然我们也可以改成这样<br>截取功能例子3：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a=bbs.verybat.cn</span><br><span class="line"><span class="built_in">set</span> var=<span class="variable">%a:~3%</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：.verybat.cn<br>这个就是把变量a的从第3位开始后面全部的值给变量VAR</p>
<p><code>%PATH:~0,-2%</code>  例子</p>
<p>截取功能例子4：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a=bbs.verybat.cn</span><br><span class="line"><span class="built_in">set</span> var=<span class="variable">%a:~0,-3%</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>执行后,我们发现显示的是”bbs.verybat”,少了”.cn”<br>从结果分析,很容易分析出,这是把变量a的值从0位开始,<br>到倒数第三位之间的值全部赋予给var</p>
<p>如果改成这样</p>
<p>截取功能例子5：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> a=bbs.verybat.cn</span><br><span class="line"><span class="built_in">set</span> var=<span class="variable">%a:~2,-3%</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%var%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：s.verybat<br>那么他就是显示从第3位（偏移量2）开始减去倒数三位字符的值,并赋予给变量var</p>
<p>讲得好，例子就是说明问题，为便于记忆，龙卷风小节如下：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">a=bbs.verybat.cn</span><br><span class="line"><span class="variable">%a:~1,2%</span>   ＝“bs”   偏移量<span class="number">1</span>，从第二位开始向右取<span class="number">2</span>位</span><br><span class="line"><span class="variable">%a:~-3%</span>    ＝“.cn”  偏移量负<span class="number">3</span>，即倒数<span class="number">3</span>位（也可理解为留下右边<span class="number">3</span>位），右取全部</span><br><span class="line"><span class="variable">%a:~3%</span>     ＝“.verybat.cn” 偏移量<span class="number">3</span>（也可理解为去掉左边<span class="number">3</span>位），右取全部</span><br><span class="line"><span class="variable">%a:~0,-3%</span>   ＝“bbs.verybat” 偏移量<span class="number">0</span>，右取长度至负<span class="number">3</span>，即倒数<span class="number">3</span>位</span><br><span class="line"><span class="variable">%a:~2,-3%</span>   ＝“s.verybat”  偏移量<span class="number">2</span>，右取长度至负<span class="number">3</span>，即倒数<span class="number">3</span>位</span><br></pre></td></tr></table></figure></p>
<p>所以，截取功能统一语法格式为：<code>%a:~[m[,n]]%</code></p>
<p>方括号表示可选，%a%为变量名，不可少，冒号用于分隔变量名和说明部分，符号～可以简单理解为“偏移”即可，m为偏移量（缺省为0），n为截取长度（缺省为全部）<br>上面所述用法其实相当于vbs函数mid. left. right<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">%a:~0,n%</span>  相当于函数left(a,n)  取左边n位</span><br><span class="line"><span class="variable">%a:~-m%</span>  相当于函数right（a,m） 取右边m位</span><br><span class="line"><span class="variable">%a:~m,n%</span> 相当于函数mid(a,m+<span class="number">1</span>,n) 从m+<span class="number">1</span>位开始取n位</span><br><span class="line"><span class="variable">%a:~m,-n%</span> 相当于函数mid(a,m+<span class="number">1</span>,len(a)-m-n),从m+<span class="number">1</span>位开始，至倒数n+<span class="number">1</span>位</span><br><span class="line">%a:~m %  相当于函数mid(a,m+<span class="number">1</span>,len(a)-m) 或者right(a,len(a)-m)，从m+<span class="number">1</span>位开始取右边全部。</span><br></pre></td></tr></table></figure></p>
<p>思考题目：输入任意字符串，求字符串的长度<br>参考答案：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p str=请输入任意长度的字符串:</span><br><span class="line"><span class="built_in">echo</span> 你输入了字符串:"<span class="variable">%str%</span>"</span><br><span class="line"><span class="keyword">call</span> :stringlenth "<span class="variable">%str%</span>" num</span><br><span class="line"><span class="built_in">echo</span> 字符串长度为：<span class="variable">%num%</span></span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"><span class="keyword">exit</span></span><br></pre></td></tr></table></figure></p>
<figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">:StringLenth</span><br><span class="line">::---------字符串长度计算子程序</span><br><span class="line">::---------参数%<span class="number">1</span>为字符串(如有空格，请用引号括起来)</span><br><span class="line">::---------参数%<span class="number">2</span>为返回变量名称，不能含空格或特殊字符</span><br><span class="line">::@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> theString=%~<span class="number">1</span></span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> <span class="keyword">defined</span> theString <span class="keyword">goto</span> :eof</span><br><span class="line"><span class="built_in">set</span> Return=<span class="number">0</span></span><br><span class="line">:StringLenth_continue</span><br><span class="line"><span class="built_in">set</span> /a Return+=<span class="number">1</span></span><br><span class="line"><span class="built_in">set</span> thestring=<span class="variable">%thestring:~0,-1%</span></span><br><span class="line"><span class="keyword">if</span> <span class="keyword">defined</span> thestring <span class="keyword">goto</span> StringLenth_continue</span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> "%<span class="number">2</span>"=="" <span class="built_in">set</span> <span class="variable">%2=%</span>Return%</span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure>
<p>好了set的一些用法,就介绍到这了,希望对各位有所帮助,时间不早睡觉Zz…. by 伤脑筋</p>
<h2 id="第六章-if命令讲解"><a href="#第六章-if命令讲解" class="headerlink" title="第六章 if命令讲解"></a>第六章 if命令讲解</h2><p>最近发现有些朋友一老问IF命令的用法,IF命令个人觉得很简单,所以就一直没把发放到新手教学贴里说,现在我给补上一文,希望对各位”非常BAT的”新手朋友们有所帮助.</p>
<p>现在开始：</p>
<p>在CMD使用IF /?打开IF的系统帮助(自己看我就不全部列出来了),我们会发现IF有3种基本的用法!<br>执行批处理程序中的条件处理。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">IF</span> [<span class="keyword">NOT</span>] <span class="keyword">ERRORLEVEL</span> number command</span><br><span class="line"><span class="keyword">IF</span> [<span class="keyword">NOT</span>] string1==string2 command</span><br><span class="line"><span class="keyword">IF</span> [<span class="keyword">NOT</span>] <span class="keyword">EXIST</span> filename command</span><br><span class="line"></span><br><span class="line">  <span class="keyword">NOT</span>               指定只有条件为 false 的情况下， Windows XP 才</span><br><span class="line">                    应该执行该命令。</span><br><span class="line"></span><br><span class="line">  <span class="keyword">ERRORLEVEL</span> number 如果最后运行的程序返回一个等于或大于</span><br><span class="line">                    指定数字的退出编码，指定条件为 true。</span><br><span class="line"></span><br><span class="line">  string1==string2  如果指定的文字字符串匹配，指定条件为 true。</span><br><span class="line"></span><br><span class="line">  <span class="keyword">EXIST</span> filename    如果指定的文件名存在，指定条件为 true。</span><br><span class="line"></span><br><span class="line">  command           如果符合条件，指定要执行的命令。如果指定的</span><br><span class="line">                     条件为 FALSE，命令后可跟一个执行 <span class="keyword">ELSE</span></span><br><span class="line">                      关键字后的命令的 <span class="keyword">ELSE</span> 命令。</span><br></pre></td></tr></table></figure></p>
<p>ELSE 子句必须在 IF 之后出现在同一行上。例如：</p>
<pre><code>IF EXIST filename (
    del filename
) ELSE (
    echo filename missing
)
</code></pre><h3 id="第一种用法：IF-NOT-ERRORLEVEL-number-command"><a href="#第一种用法：IF-NOT-ERRORLEVEL-number-command" class="headerlink" title="第一种用法：IF [NOT] ERRORLEVEL number command"></a>第一种用法：IF [NOT] ERRORLEVEL number command</h3><p>这个用法的基本做用是判断上一条命令执行结果的代码,以决定下一个步骤.<br>一般上一条命令的执行结果代码只有两结果,”成功”用0表示  “失败”用1表示.</p>
<p>举个例子：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">net</span> user</span><br><span class="line"><span class="keyword">IF</span> <span class="variable">%ERRORLEVEL%</span> == <span class="number">0</span> <span class="built_in">echo</span> <span class="built_in">net</span> user 执行成功了!</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>这是个简单判断上条命令是否执行成功.<br>细心的朋友可能会发现,这个用法和帮助里的用法不太一样,按照帮助里的写法”IF %ERRORLEVEL% == 0 echo net user 执行成功了!  “这一句代码应该写成 IF ERRORLEVEL 0 echo net user 执行成功了!<br>那为什么我要写成这样呢?各位自己把代码改掉执行后,就会发现错误了!用这种语法,不管你的上面的命令是否执行成功,他都会认为命令成功了,不知道是BUG还是本人理解错误…</p>
<p>补充：这不是bug，而是 if errorlevel 语句的特点：当使用 if errorlevel 0 …… 的句式时，它的含义是：如果错误码的值大于或等于0的时候，将执行某个操作；当使用 if %errorlevel%==0 …… 的句式时，它的含义是：如果错误码的值等于0的时候，将执行某操作。因为这两种句式含义的差别，如果使用前一种句式的时候，错误码语句的排列顺序是从大到小排列</p>
<p>%ERRORLEVEL% 这是个系统变量,返回上条命令的执行结果代码! “成功”用0表示  “失败”用1表示. 当然还有其他参数,用的时候基本就这两数字.<br>一般上一条命令的执行结果代码只有两结果,”成功”用0表示  “失败”用1表示<br>　　这只是一般的情况，实际上，errorlevel返回值可以在0~255之间，比如，xcopy默认的errorlevel值就有5个，分别表示5种执行状态：</p>
<p>退出码 说明<br>0 文件复制没有错误。<br>1 if errorlevel 2 echo。<br>2 用户按 CTRL+C 终止了 xcopy。<br>4 出现了初始化错误。没有足够的内存或磁盘空间，或命令行上输入了无效的驱动器名称或语法。<br>5 出现了磁盘写入错误。</p>
<p>要判断上面xcopy命令的5种退出情况，应写成：<br>if errorlevel 5 echo出现了磁盘写入错误<br>if errorlevel 4 echo出现了初始化错误<br>if errorlevel 2 echo用户按 CTRL+C 终止了 xcopy<br>if errorlevel 1 echo if errorlevel 2 echo<br>if errorlevel 0 echo文件复制没有错误。<br>才能正确执行。</p>
<p>补充完毕。</p>
<p>再举几个例子给新手理解<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">net</span> usertest</span><br><span class="line"><span class="keyword">IF</span> <span class="variable">%ERRORLEVEL%</span> == <span class="number">1</span> <span class="built_in">echo</span> <span class="built_in">net</span> user 执行失败了!</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>这个是判断上一条命令是否执行失败的<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p var=随便输入个命令:</span><br><span class="line"><span class="variable">%var%</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%ERRORLEVEL%</span> == <span class="number">0</span> <span class="keyword">goto</span> yes</span><br><span class="line"><span class="keyword">goto</span> no</span><br><span class="line">:yes</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">!var!</span> 执行成功了</span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"><span class="keyword">exit</span></span><br><span class="line">:no</span><br><span class="line"><span class="built_in">echo</span> 基本上执行失败了..</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>这个是根据你输入的命令,自动判断是成功还是失败了!</p>
<p>在来一个简化版的<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p var=随便输入个命令:</span><br><span class="line"><span class="variable">%var%</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%ERRORLEVEL%</span> == <span class="number">0</span> (<span class="built_in">echo</span> <span class="variable">%var%</span>执行成功了) <span class="keyword">ELSE</span> <span class="built_in">echo</span> <span class="variable">%var%</span>执行失败了!</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>else后面写上执行失败后的操作!</p>
<p>当然我门还可以把if else这样的语句分成几行写出来,使他看上去好看点…<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p var=随便输入个命令:</span><br><span class="line"><span class="variable">%var%</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%ERRORLEVEL%</span> == <span class="number">0</span>  (</span><br><span class="line">   <span class="built_in">echo</span> <span class="variable">!var!</span> 执行成功了</span><br><span class="line">   ) <span class="keyword">ELSE</span> (</span><br><span class="line">   <span class="built_in">echo</span> 基本上执行失败了..</span><br><span class="line">   )</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>这里介绍的两种简写对IF的三种语法都可以套用,不单单是在IF [NOT] ERRORLEVEL number command<br>这种法上才能用</p>
<h3 id="第二种用法：IF-NOT-string1-string2-command"><a href="#第二种用法：IF-NOT-string1-string2-command" class="headerlink" title="第二种用法：IF [NOT] string1==string2 command"></a>第二种用法：IF [NOT] string1==string2 command</h3><p>这个呢就是用来比较变量或者字符的值是不是相等的.</p>
<p>例子<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p var=请输入第一个比较字符:</span><br><span class="line"><span class="built_in">set</span> /p var2=请输入第二个比较字符:</span><br><span class="line"><span class="keyword">if</span> <span class="variable">%var%</span> == <span class="variable">%var2%</span> (<span class="built_in">echo</span> 我们相等) <span class="keyword">ELSE</span> <span class="built_in">echo</span> 我们不相等</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>上面这个例子可以判断你输入的值是不是相等,但是你如果输入相同的字符,但是如果其中一个后面打了一个空格,<br>这个例子还是会认为相等,如何让有空格的输入不相等呢?我们在比较字符上加个双引号就可以了.<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p var=请输入第一个比较字符:</span><br><span class="line"><span class="built_in">set</span> /p var2=请输入第二个比较字符(多输入个空格试试):</span><br><span class="line"><span class="keyword">if</span> "<span class="variable">%var%</span>" == "<span class="variable">%var2%</span>" (<span class="built_in">echo</span> 我们相等) <span class="keyword">ELSE</span> <span class="built_in">echo</span> 我们不相等</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="第三种用法：IF-NOT-EXIST-filename-command"><a href="#第三种用法：IF-NOT-EXIST-filename-command" class="headerlink" title="第三种用法：IF [NOT] EXIST filename command"></a>第三种用法：IF [NOT] EXIST filename command</h3><p>这个就是判断某个文件或者文件夹是否存在的语法</p>
<p>例子<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">if</span> <span class="keyword">exist</span> "c:\test" (<span class="built_in">echo</span> 存在文件) <span class="keyword">ELSE</span> <span class="built_in">echo</span> 不存在文件</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>判断的文件路径加引号是为了防止路径有空格,如果路径有空格加个双引号就不会出现判断出错了!</p>
<p>这个语法没什么太多的用法,基本就这样了,就不多介绍了.</p>
<p>另外我们看到每条IF用法后都有个[NOT]语句,这啥意思?其他加上他的话,就表示先判断我们的条件不成立时,<br>没加他默认是先判断条件成立时,比如上面这个例子<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> <span class="keyword">exist</span> "c:\test" (<span class="built_in">echo</span> 存在文件) <span class="keyword">ELSE</span> <span class="built_in">echo</span> 不存在文件</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>加个NOT,执行后有什么结果,如果你的C盘下根本就没<code>c:\test</code>,他还是会显示”存在文件”,这就表示了加了NOT就<br>会先判断条件失败!懂了吧,上面例子改成这样就正确了!<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> <span class="keyword">exist</span> "c:\test" (<span class="built_in">echo</span> 不存在文件) <span class="keyword">ELSE</span> <span class="built_in">echo</span> 存在文件</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="第四种用法：IF增强的用法"><a href="#第四种用法：IF增强的用法" class="headerlink" title="第四种用法：IF增强的用法"></a>第四种用法：IF增强的用法</h3><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">IF</span> [/I] string1 compare-op string2 command  #参数/I表示不区分大小写</span><br><span class="line"><span class="keyword">IF</span> CMDEXTVERSION number command</span><br><span class="line"><span class="keyword">IF</span> <span class="keyword">DEFINED</span> variable command  #判断变量是否存在，很有用</span><br></pre></td></tr></table></figure>
<p>CMDEXTVERSION 条件的作用跟 ERRORLEVEL 的一样，除了它<br>是在跟与命令扩展名有关联的内部版本号比较。第一个版本<br>是 1。每次对命令扩展名有相当大的增强时，版本号会增加一个。<br>命令扩展名被停用时，CMDEXTVERSION 条件不是真的。</p>
<p>如果已定义环境变量，DEFINED 条件的作用跟 EXISTS 的一样<br><code>IF DEFINED variable command</code><br><code>IF NOT &quot;variable&quot;==&quot;&quot; command</code><br>上面两条命令效果一样。</p>
<p>用“set variable=”命令使变量variable变成未定义，即空值。</p>
<p>一句话，变量值为空，则为未定义；变量值不为空，则为已定义。<br>用语句IF DEFINED variable command判断变量是否存在时，请注意variable为不使用引导符号%的变量名，不能用写为%variable%，否则出错。</p>
<p>例：<br><code>if defined aa (echo 变量aa存在) else (echo 变量aa不存在)</code><br>运行显示：变量aa不存在</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">set</span> aa=<span class="number">123</span></span><br><span class="line"><span class="built_in">set</span> aa=</span><br><span class="line"><span class="keyword">if</span> <span class="keyword">defined</span> aa (<span class="built_in">echo</span> 变量aa存在) <span class="keyword">else</span> (<span class="built_in">echo</span> 变量aa不存在)</span><br></pre></td></tr></table></figure></p>
<p>运行显示：变量aa不存在</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">if</span> a == A (<span class="built_in">echo</span> 我们相等) <span class="keyword">ELSE</span> <span class="built_in">echo</span> 我们不相等</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>执行后会显示：我们不相等</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">if</span> /i a == A (<span class="built_in">echo</span> 我们相等) <span class="keyword">ELSE</span> <span class="built_in">echo</span> 我们不相等</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>加上/I不区分大小写就相等了!</p>
<p>最后面还有一些用来判断数字的符号</p>
<pre><code>EQU - 等于
NEQ - 不等于
LSS - 小于
LEQ - 小于或等于
GTR - 大于
GEQ - 大于或等于
</code></pre><p>我就举一个例子,大家都懂数学…不讲多了<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p var=请输入一个数字:</span><br><span class="line"><span class="keyword">if</span> <span class="variable">%var%</span> <span class="keyword">LEQ</span>  <span class="number">4</span> (<span class="built_in">echo</span> 我小于等于<span class="number">4</span>) <span class="keyword">ELSE</span> <span class="built_in">echo</span> 我不小于等于<span class="number">4</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h2 id="第七章-DOS编程高级技巧"><a href="#第七章-DOS编程高级技巧" class="headerlink" title="第七章 DOS编程高级技巧"></a>第七章 DOS编程高级技巧</h2><p>本章节乃龙卷风根据自己平时学用批处理的经验而总结的，不断补充中……。</p>
<h3 id="一-交互界面设计"><a href="#一-交互界面设计" class="headerlink" title="一. 交互界面设计"></a>一. 交互界面设计</h3><p>没啥说的，看看高手设计的菜单界面吧：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">cls</span></span><br><span class="line"><span class="built_in">title</span> 终极多功能修复</span><br><span class="line">:menu</span><br><span class="line"><span class="built_in">cls</span></span><br><span class="line"><span class="built_in">color</span> <span class="number">0</span>A</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>                 ==============================</span><br><span class="line"><span class="built_in">echo</span>                 请选择要进行的操作，然后按回车</span><br><span class="line"><span class="built_in">echo</span>                 ==============================</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>              <span class="number">1</span>.网络修复及上网相关设置,修复IE,自定义屏蔽网站</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>              <span class="number">2</span>.病毒专杀工具，端口关闭工具,关闭自动播放</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>              <span class="number">3</span>.清除所有多余的自启动项目，修复系统错误</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>              <span class="number">4</span>.清理系统垃圾,提高启动速度</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>              Q.退出</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line">:cho</span><br><span class="line"><span class="built_in">set</span> choice=</span><br><span class="line"><span class="built_in">set</span> /p choice=          请选择:</span><br><span class="line"><span class="keyword">IF</span> <span class="keyword">NOT</span> "<span class="variable">%choice%</span>"=="" <span class="built_in">SET</span> choice=<span class="variable">%choice:~0,1%</span></span><br><span class="line"><span class="keyword">if</span> /i "<span class="variable">%choice%</span>"=="<span class="number">1</span>" <span class="keyword">goto</span> ip</span><br><span class="line"><span class="keyword">if</span> /i "<span class="variable">%choice%</span>"=="<span class="number">2</span>" <span class="keyword">goto</span> setsave</span><br><span class="line"><span class="keyword">if</span> /i "<span class="variable">%choice%</span>"=="<span class="number">3</span>" <span class="keyword">goto</span> kaiji</span><br><span class="line"><span class="keyword">if</span> /i "<span class="variable">%choice%</span>"=="<span class="number">4</span>" <span class="keyword">goto</span> clean</span><br><span class="line"><span class="keyword">if</span> /i "<span class="variable">%choice%</span>"=="Q" <span class="keyword">goto</span> endd</span><br><span class="line"><span class="built_in">echo</span> 选择无效，请重新输入</span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="keyword">goto</span> cho</span><br></pre></td></tr></table></figure></p>
<p>只要学完本教程前面的章节，上面的程序应该能看懂了。</p>
<h3 id="二-if…else…条件语句"><a href="#二-if…else…条件语句" class="headerlink" title="二. if…else…条件语句"></a>二. if…else…条件语句</h3><p>前面已经谈到，DOS条件语句主要有以下形式<br>IF [NOT] ERRORLEVEL number command<br>IF [NOT] string1==string2 command<br>IF [NOT] EXIST filename command<br>增强用法：IF [/I] string1 compare-op string2 command<br>增强用法中加上/I就不区分大小写了!<br>增强用法中还有一些用来判断数字的符号：</p>
<p>EQU - 等于<br>NEQ - 不等于<br>LSS - 小于<br>LEQ - 小于或等于<br>GTR - 大于<br>GEQ - 大于或等于</p>
<p>上面的command命令都可以用小括号来使用多条命令的组合，包括else子句，组合命令中可以嵌套使用条件或循环命令。</p>
<p>例如：</p>
<pre><code>IF EXIST filename (
    del filename
) ELSE (
    echo filename missing
)
</code></pre><p>也可写成：<br>if exist filename (del filename) else (echo filename missing)<br>但这种写法不适合命令太多或嵌套命令的使用。</p>
<h3 id="三-循环语句"><a href="#三-循环语句" class="headerlink" title="三. 循环语句"></a>三. 循环语句</h3><ol>
<li><p>指定次数循环</p>
<figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /L %variable <span class="keyword">IN</span> (<span class="built_in">start</span>,step,end) <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"></span><br><span class="line">组合命令：</span><br><span class="line"><span class="keyword">FOR</span> /L %variable <span class="keyword">IN</span> (<span class="built_in">start</span>,step,end) <span class="keyword">DO</span> (</span><br><span class="line">Command1</span><br><span class="line">Command2</span><br><span class="line">……</span><br><span class="line">)</span><br></pre></td></tr></table></figure>
</li>
<li><p>对某集合执行循环语句。</p>
<figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> <span class="variable">%%v</span>ariable <span class="keyword">IN</span> (<span class="built_in">set</span>) <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"></span><br><span class="line">  <span class="variable">%%v</span>ariable  指定一个单一字母可替换的参数。</span><br><span class="line">  (<span class="built_in">set</span>)      指定一个或一组文件。可以使用通配符。</span><br><span class="line">  command   对每个文件执行的命令，可用小括号使用多条命令组合。</span><br><span class="line"></span><br><span class="line"><span class="keyword">FOR</span> /R [[drive:]<span class="built_in">path</span>] %variable <span class="keyword">IN</span> (<span class="built_in">set</span>) <span class="keyword">DO</span> command [command-parameters]</span><br><span class="line"></span><br><span class="line">    检查以 [drive:]<span class="built_in">path</span> 为根的目录树，指向每个目录中的</span><br><span class="line">    <span class="keyword">FOR</span> 语句。如果在 /R 后没有指定目录，则使用当前目录。如果集仅为一个单点(.)字符，</span><br><span class="line">    则枚举该目录树。</span><br></pre></td></tr></table></figure>
</li>
</ol>
<p>同前面一样，command可以用括号来组合：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">FOR</span> /R [[drive:]<span class="built_in">path</span>] %variable <span class="keyword">IN</span> (<span class="built_in">set</span>) <span class="keyword">DO</span> (</span><br><span class="line">Command1</span><br><span class="line">Command2</span><br><span class="line">……</span><br><span class="line">commandn</span><br><span class="line">)</span><br></pre></td></tr></table></figure></p>
<ol start="3">
<li>条件循环<br>上面的循环结构是用for命令来实现的，for命令循环有一个缺点，就是整个循环被当作一条命令语句，涉及到变量延迟的问题。<br>利用goto语句和条件判断，dos可以实现条件循环，很简单啦，看例子：</li>
</ol>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> var=<span class="number">0</span></span><br><span class="line"><span class="comment">rem ************循环开始了</span></span><br><span class="line">:continue</span><br><span class="line"><span class="built_in">set</span> /a var+=<span class="number">1</span></span><br><span class="line"><span class="built_in">echo</span> 第<span class="variable">%var%</span>次循环</span><br><span class="line"><span class="keyword">if</span> <span class="variable">%var%</span> <span class="keyword">lss</span> <span class="number">100</span> <span class="keyword">goto</span> continue</span><br><span class="line"><span class="comment">rem ************循环结束了</span></span><br><span class="line"><span class="built_in">echo</span> 循环执行完毕</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> var=<span class="number">100</span></span><br><span class="line"><span class="comment">rem ************循环开始了</span></span><br><span class="line">:continue</span><br><span class="line"><span class="built_in">echo</span> 第<span class="variable">%var%</span>次循环</span><br><span class="line"><span class="built_in">set</span> /a var-=<span class="number">1</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%var%</span> <span class="keyword">gtr</span> <span class="number">0</span> <span class="keyword">goto</span> continue</span><br><span class="line"><span class="comment">rem ************循环结束了</span></span><br><span class="line"><span class="built_in">echo</span> 循环执行完毕</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="四-子程序"><a href="#四-子程序" class="headerlink" title="四. 子程序"></a>四. 子程序</h3><p>在批处理程序中可以调用外部可运行程序，比如exe程序，也可调用其他批处理程序，这些也可以看作子程序，但是不够方便，如果被调用的程序很多，就显得不够简明了，很繁琐。<br>   在windowsXP中，批处理可以调用本程序中的一个程序段，相当于子程序，这些子程序一般放在主程序后面。</p>
<p>子程序调用格式：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">CALL</span> :<span class="built_in">label</span> arguments</span><br></pre></td></tr></table></figure></p>
<p>子程序语法：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">:<span class="built_in">label</span></span><br><span class="line">command1</span><br><span class="line">command2</span><br><span class="line">......</span><br><span class="line">commandn</span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<p>在子程序段中，参数<code>%0</code>指标签<code>:label</code></p>
<p>子过程一般放在最后，并且注意在主程序最后要加上exit或跳转语句，避免错误的进入子过程。</p>
<p>子程序和主程序中的变量都是全局变量，其作用范围都是整个批处理程序。</p>
<p>传至子程序的参数在call语句中指定，在子程序中用%1. %2至%9的形式调用，而子程序返回主程序的数据只需在调用结束后直接引用就可以了，当然也可以指定返回变量，请看下面的例子。</p>
<p>子程序例1：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">call</span> :sub return 你好</span><br><span class="line"><span class="built_in">echo</span> 子程序返回值：<span class="variable">%return%</span></span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"></span><br><span class="line">:sub</span><br><span class="line"><span class="built_in">set</span> <span class="variable">%1=%</span><span class="number">2</span></span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<p>运行结果：你好</p>
<p>子程序例2：设计一个求多个整数相加的子程序<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> sum=<span class="number">0</span></span><br><span class="line"><span class="keyword">call</span> :sub sum <span class="number">10</span> <span class="number">20</span> <span class="number">35</span></span><br><span class="line"><span class="built_in">echo</span> 数据求和结果：<span class="variable">%sum%</span></span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"></span><br><span class="line">:sub</span><br><span class="line"><span class="comment">rem 参数1为返回变量名称</span></span><br><span class="line"><span class="built_in">set</span> /a <span class="variable">%1=%</span><span class="number">1</span>+%<span class="number">2</span></span><br><span class="line"><span class="built_in">shift</span> /<span class="number">2</span></span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> "%<span class="number">2</span>"=="" <span class="keyword">goto</span> sub</span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<p>运行结果：65</p>
<p>在win98系统中，不支持上面这种标号调用，须将子程序单独保存为一个批处理程序，然后调用。</p>
<h3 id="五-用ftp命令实现自动下载"><a href="#五-用ftp命令实现自动下载" class="headerlink" title="五. 用ftp命令实现自动下载"></a>五. 用ftp命令实现自动下载</h3><p>ftp是常用的下载工具，ftp界面中有40多个常用命令，自己学习了，不介绍了。这里介绍如何用dos命令行调用ftp命令，实现ftp自动登录，并上传下载，并自动退出ftp程序。<br>其实可以将ftp命令组合保存为一个文本文件，然后用以下命令调用即可。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ftp  -n -s:[[drive:]<span class="built_in">path</span>]filename</span><br></pre></td></tr></table></figure></p>
<p>上面的filename为ftp命令文件，包括登录IP地址，用户名. 密码. 操作命令等<br>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">open <span class="number">90</span>.<span class="number">52</span>.<span class="number">8</span>.<span class="number">3</span>   ＃打开ip</span><br><span class="line">user iware       ＃用户为iware</span><br><span class="line">password8848    ＃密码</span><br><span class="line">bin             ＃二进制传输模式</span><br><span class="line">prompt</span><br><span class="line"><span class="built_in">cd</span> tmp1         ＃切换至iware用户下的tmp1目录</span><br><span class="line">pwd</span><br><span class="line">lcd d:\download   ＃本地目录</span><br><span class="line">mget *          ＃下载tmp1目录下的所有文件</span><br><span class="line">bye             ＃退出ftp</span><br></pre></td></tr></table></figure></p>
<h3 id="六-用7-ZIP实现命令行压缩和解压功能"><a href="#六-用7-ZIP实现命令行压缩和解压功能" class="headerlink" title="六. 用7-ZIP实现命令行压缩和解压功能"></a>六. 用7-ZIP实现命令行压缩和解压功能</h3><p>语法格式：（详细情况见7-zip帮助文件，看得头晕可以跳过，用到再学）<br>7z <command> [<switch>…] &lt;base_archive_name&gt; [<arguments>…]</arguments></switch></p>
<p>7z.exe的每个命令都有不同的参数<switch>,请看帮助文件</switch></p>
<p>&lt;base_archive_name&gt;为压缩包名称</p>
<p><arguments>为文件名称，支持通配符或文件列表</arguments></p>
<p>其中，7z是至命令行压缩解压程序7z.exe，<command>是7z.exe包含的命令，列举如下：</p>
<p>a： Adds files to archive. 添加至压缩包<br>a命令可用参数：<br>  -i (Include)<br>  -m (Method)<br>  -p (Set Password)<br>  -r (Recurse)<br>  -sfx (create SFX)<br>  -si (use StdIn)<br>  -so (use StdOut)<br>  -ssw (Compress shared files)<br>  -t (Type of archive)<br>  -u (Update)<br>  -v (Volumes)<br>  -w (Working Dir)<br>  -x (Exclude)</p>
<p>b： Benchmark</p>
<p>d： Deletes files from archive. 从压缩包中删除文件<br>d命令可用参数：<br>  -i (Include)<br>  -m (Method)<br>  -p (Set Password)<br>  -r (Recurse)<br>  -u (Update)<br>  -w (Working Dir)<br>  -x (Exclude)</p>
<p>e： Extract解压文件至当前目录或指定目录<br>e命令可用参数：<br>  -ai (Include archives)<br>  -an (Disable parsing of archive_name)<br>  -ao (Overwrite mode)<br>  -ax (Exclude archives)<br>  -i (Include)<br>  -o (Set Output Directory)<br>  -p (Set Password)<br>  -r (Recurse)<br>  -so (use StdOut)<br>  -x (Exclude)<br>  -y (Assume Yes on all queries)</p>
<p>l： Lists contents of archive.<br>t： Test<br>u： Update</p>
<p>x： eXtract with full paths用文件的完整路径解压至当前目录或指定目录<br>x命令可用参数：<br>  -ai (Include archives)<br>  -an (Disable parsing of archive_name)<br>  -ao (Overwrite mode)<br>  -ax (Exclude archives)<br>  -i (Include)<br>  -o (Set Output Directory)<br>  -p (Set Password)<br>  -r (Recurse)<br>  -so (use StdOut)<br>  -x (Exclude)<br>  -y (Assume Yes on all queries)</p>
<p>七. 调用VBScript程序</p>
<p>使用 Windows 脚本宿主，可以在命令提示符下运行脚本。CScript.exe 提供了用于设置脚本属性的命令行开关。</p>
<figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">用法：CScript 脚本名称 [脚本选项...] [脚本参数...]</span><br><span class="line"></span><br><span class="line">选项：</span><br><span class="line"> //B         批模式：不显示脚本错误及提示信息</span><br><span class="line"> //D         启用 Active Debugging</span><br><span class="line"> //E:engine  使用执行脚本的引擎</span><br><span class="line"> //H:CScript 将默认的脚本宿主改为 CScript.exe</span><br><span class="line"> //H:WScript 将默认的脚本宿主改为 WScript.exe （默认）</span><br><span class="line"> //I         交互模式（默认，与 //B 相对)</span><br><span class="line"> //Job:xxxx  执行一个 WSF 工作</span><br><span class="line"> //Logo      显示徽标（默认）</span><br><span class="line"> //Nologo    不显示徽标：执行时不显示标志</span><br><span class="line"> //S         为该用户保存当前命令行选项</span><br><span class="line"> //T:nn      超时设定秒：允许脚本运行的最长时间</span><br><span class="line"> //X         在调试器中执行脚本</span><br><span class="line"> //U         用 Unicode 表示来自控制台的重定向 I/O</span><br></pre></td></tr></table></figure>
<p>“脚本名称”是带有扩展名和必需的路径信息的脚本文件名称，如<code>d:\admin\vbscripts\chart.vbs</code>。<br>“脚本选项和参数”将传递给脚本。脚本参数前面有一个斜杠 (/)。每个参数都是可选的；但不能在未指定脚本名称的情况下指定脚本选项。如果未指定参数，则 CScript 将显示 CScript 语法和有效的宿主参数。</p>
<h3 id="八-将批处理转化为可执行文件："><a href="#八-将批处理转化为可执行文件：" class="headerlink" title="八. 将批处理转化为可执行文件："></a>八. 将批处理转化为可执行文件：</h3><p>由于批处理文件是一种文本文件，任何人都可以对其进行随便编辑，不小心就会把里面的命令破坏掉，所以如果将其转换成.com格式的可执行文件，不仅执行效率会大大提高，而且不会破坏原来的功能，更能将优先级提到最高。Bat2Com就可以完成这个转换工作。<br>小知识：在DOS环境下，可执行文件的优先级由高到低依次为<code>.com&gt;.exe&gt;.bat&gt;.cmd</code>，即如果在同一目录下存在文件名相同的这四类文件，当只键入文件名时，DOS执行的是<code>name.com</code>，如果需要执行其他三个文件，则必须指定文件的全名，如name.bat。</p>
<p>这是一个只有5.43K大小的免费绿色工具，可以运行在纯DOS或DOS窗口的命令行中，用法：Bat2Com<br>FileName，这样就会在同一目录下生成一个名为FileNme.com的可执行文件，执行的效果和原来的.bat文件一样。</p>
<h3 id="九-时间延迟"><a href="#九-时间延迟" class="headerlink" title="九. 时间延迟"></a>九. 时间延迟</h3><p>本条参考引用[英雄]教程<br>什么是时间延迟？顾名思义，就是执行一条命令后延迟一段时间再进行下一条命令。<br>延迟的应用见下节：“模拟进度条”。</p>
<h4 id="1-利用ping命令延时"><a href="#1-利用ping命令延时" class="headerlink" title="1. 利用ping命令延时"></a>1. 利用ping命令延时</h4><p> 例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> 延时前：<span class="variable">%time%</span></span><br><span class="line"><span class="built_in">ping</span> /n <span class="number">3</span> <span class="number">127</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">1</span> &gt;<span class="built_in">nul</span></span><br><span class="line"><span class="built_in">echo</span> 延时后：<span class="variable">%time%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>解说：用到了ping命令的“/n”参数，表示要发送多少次请求到指定的ip。本例中要发送3次请求到本机的ip（127.0.0.1）。127.0.0.1可简写为127.1。“&gt;nul”就是屏蔽掉ping命令所显示的内容。</p>
<h4 id="2-利用for命令延时"><a href="#2-利用for命令延时" class="headerlink" title="2. 利用for命令延时"></a>2. 利用for命令延时</h4><p> 例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> 延时前：<span class="variable">%time%</span></span><br><span class="line"><span class="keyword">for</span> /l <span class="variable">%%i</span> <span class="keyword">in</span> (<span class="number">1</span>,<span class="number">1</span>,<span class="number">5000</span>) <span class="keyword">do</span> <span class="built_in">echo</span> <span class="variable">%%i</span>&gt;<span class="built_in">nul</span></span><br><span class="line"><span class="built_in">echo</span> 延时后：<span class="variable">%time%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>解说：原理很简单，就是利用一个计次循环并屏蔽它所显示的内容来达到延时的目的。</p>
<h4 id="3-利用vbs延迟函数，精确度毫秒，误差1000毫秒内"><a href="#3-利用vbs延迟函数，精确度毫秒，误差1000毫秒内" class="headerlink" title="3. 利用vbs延迟函数，精确度毫秒，误差1000毫秒内"></a>3. 利用vbs延迟函数，精确度毫秒，误差1000毫秒内</h4><p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%time%</span></span><br><span class="line"><span class="keyword">call</span> :delay <span class="number">5000</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%time%</span></span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"><span class="keyword">exit</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">:delay</span><br><span class="line"><span class="built_in">echo</span> WScript.Sleep %<span class="number">1</span>&gt;delay.vbs</span><br><span class="line">CScript //B delay.vbs</span><br><span class="line"><span class="built_in">del</span> delay.vbs</span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<p>运行显示：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">10</span>:<span class="number">44</span>:<span class="number">06</span>.<span class="number">45</span></span><br><span class="line"><span class="number">10</span>:<span class="number">44</span>:<span class="number">11</span>.<span class="number">95</span></span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<p>上面的运行结果显示实际延时了5500毫秒，多出来的500毫秒时建立和删除临时文件所耗费的时间。误差在一秒之内。</p>
<h4 id="4-仅用批处理命令实现任意时间延迟，精确度10毫秒，误差50毫秒内"><a href="#4-仅用批处理命令实现任意时间延迟，精确度10毫秒，误差50毫秒内" class="headerlink" title="4. 仅用批处理命令实现任意时间延迟，精确度10毫秒，误差50毫秒内"></a>4. 仅用批处理命令实现任意时间延迟，精确度10毫秒，误差50毫秒内</h4><p>仅用批处理命令就可以实现延迟操作。</p>
<p>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> /p delay=请输入需延迟的毫秒数：</span><br><span class="line"><span class="built_in">set</span> TotalTime=<span class="number">0</span></span><br><span class="line"><span class="built_in">set</span> NowTime=<span class="variable">%time%</span></span><br><span class="line">::读取起始时间，时间格式为：<span class="number">13</span>:<span class="number">01</span>:<span class="number">05</span>.<span class="number">95</span></span><br><span class="line"><span class="built_in">echo</span> 程序开始时间：<span class="variable">%NowTime%</span></span><br><span class="line">:delay_continue</span><br><span class="line"><span class="built_in">set</span> /a minute1=<span class="number">1</span><span class="variable">%NowTime:~3,2%</span>-<span class="number">100</span></span><br><span class="line">::读取起始时间的分钟数</span><br><span class="line"><span class="built_in">set</span> /a second1=<span class="number">1</span><span class="variable">%NowTime:~-5,2%</span><span class="variable">%NowTime:~-2%</span><span class="number">0</span>-<span class="number">100000</span></span><br><span class="line">::将起始时间的秒数转为毫秒</span><br><span class="line"><span class="built_in">set</span> NowTime=<span class="variable">%time%</span></span><br><span class="line"><span class="built_in">set</span> /a minute2=<span class="number">1</span><span class="variable">%NowTime:~3,2%</span>-<span class="number">100</span></span><br><span class="line">:: 读取现在时间的分钟数</span><br><span class="line"><span class="built_in">set</span> /a second2=<span class="number">1</span><span class="variable">%NowTime:~-5,2%</span><span class="variable">%NowTime:~-2%</span><span class="number">0</span>-<span class="number">100000</span></span><br><span class="line">::将现在时间的秒数转为毫秒</span><br><span class="line"><span class="built_in">set</span> /a TotalTime+=(<span class="variable">%minute2%</span>-<span class="variable">%minute1%</span>+<span class="number">60</span>)<span class="variable">%%6</span>0*<span class="number">60000</span>+<span class="variable">%second2%</span>-<span class="variable">%second1%</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%TotalTime%</span> <span class="keyword">lss</span> <span class="variable">%delay%</span> <span class="keyword">goto</span> delay_continue</span><br><span class="line"><span class="built_in">echo</span> 程序结束时间：<span class="variable">%time%</span></span><br><span class="line"><span class="built_in">echo</span> 设定延迟时间：<span class="variable">%delay%</span>毫秒</span><br><span class="line"><span class="built_in">echo</span> 实际延迟时间：<span class="variable">%TotalTime%</span>毫秒</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">请输入需延迟的毫秒数：<span class="number">6000</span></span><br><span class="line">程序开始时间：<span class="number">15</span>:<span class="number">32</span>:<span class="number">16</span>.<span class="number">37</span></span><br><span class="line">程序结束时间：<span class="number">15</span>:<span class="number">32</span>:<span class="number">22</span>.<span class="number">37</span></span><br><span class="line">设定延迟时间：<span class="number">6000</span>毫秒</span><br><span class="line">实际延迟时间：<span class="number">6000</span>毫秒</span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<p>实现原理：首先设定要延迟的毫秒数，然后用循环累加时间，直到累加时间大于等于延迟时间。</p>
<p>误差：windows系统时间只能精确到10毫秒，所以理论上有可能存在10毫秒误差。<br>经测试，当延迟时间大于500毫秒时，上面的延迟程序一般不存在误差。当延迟时间小于500毫秒时，可能有几十毫秒误差，为什么？因为延迟程序本身也是有运行时间的，同时系统时间只能精确到10毫秒。</p>
<p>为了方便引用，可将上面的例子改为子程序调用形式：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">echo</span> 程序开始时间：<span class="variable">%Time%</span></span><br><span class="line"><span class="keyword">call</span> :delay <span class="number">10</span></span><br><span class="line"><span class="built_in">echo</span> 实际延迟时间：<span class="variable">%totaltime%</span>毫秒</span><br><span class="line"><span class="built_in">echo</span> 程序结束时间：<span class="variable">%time%</span></span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"><span class="keyword">exit</span></span><br><span class="line"></span><br><span class="line">::-----------以下为延时子程序--------------------</span><br><span class="line">:delay</span><br><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">if</span> "%<span class="number">1</span>"=="" <span class="keyword">goto</span> :eof</span><br><span class="line"><span class="built_in">set</span> DelayTime=%<span class="number">1</span></span><br><span class="line"><span class="built_in">set</span> TotalTime=<span class="number">0</span></span><br><span class="line"><span class="built_in">set</span> NowTime=<span class="variable">%time%</span></span><br><span class="line">::读取起始时间，时间格式为：<span class="number">13</span>:<span class="number">01</span>:<span class="number">05</span>.<span class="number">95</span></span><br><span class="line">:delay_continue</span><br><span class="line"><span class="built_in">set</span> /a minute1=<span class="number">1</span><span class="variable">%NowTime:~3,2%</span>-<span class="number">100</span></span><br><span class="line"><span class="built_in">set</span> /a second1=<span class="number">1</span><span class="variable">%NowTime:~-5,2%</span><span class="variable">%NowTime:~-2%</span><span class="number">0</span>-<span class="number">100000</span></span><br><span class="line"><span class="built_in">set</span> NowTime=<span class="variable">%time%</span></span><br><span class="line"><span class="built_in">set</span> /a minute2=<span class="number">1</span><span class="variable">%NowTime:~3,2%</span>-<span class="number">100</span></span><br><span class="line"><span class="built_in">set</span> /a second2=<span class="number">1</span><span class="variable">%NowTime:~-5,2%</span><span class="variable">%NowTime:~-2%</span><span class="number">0</span>-<span class="number">100000</span></span><br><span class="line"><span class="built_in">set</span> /a TotalTime+=(<span class="variable">%minute2%</span>-<span class="variable">%minute1%</span>+<span class="number">60</span>)<span class="variable">%%6</span>0*<span class="number">60000</span>+<span class="variable">%second2%</span>-<span class="variable">%second1%</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%TotalTime%</span> <span class="keyword">lss</span> <span class="variable">%DelayTime%</span> <span class="keyword">goto</span> delay_continue</span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<h3 id="十-模拟进度条"><a href="#十-模拟进度条" class="headerlink" title="十. 模拟进度条"></a>十. 模拟进度条</h3><p>下面给出一个模拟进度条的程序。如果将它运用在你自己的程序中，可以使你的程序更漂亮。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">mode</span> <span class="built_in">con</span> cols=<span class="number">113</span> lines=<span class="number">15</span> &amp;<span class="built_in">color</span> <span class="number">9</span>f</span><br><span class="line"><span class="built_in">cls</span></span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>  程序正在初始化. . . </span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span>  ┌──────────────────────────────────────┐</span><br><span class="line"><span class="built_in">set</span>/p=  ■&lt;<span class="built_in">nul</span></span><br><span class="line"><span class="keyword">for</span> /L <span class="variable">%%i</span> <span class="keyword">in</span> (<span class="number">1</span> <span class="number">1</span> <span class="number">38</span>) <span class="keyword">do</span> <span class="built_in">set</span> /p a=■&lt;<span class="built_in">nul</span>&amp;<span class="built_in">ping</span> /n <span class="number">1</span> <span class="number">127</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">1</span>&gt;<span class="built_in">nul</span></span><br><span class="line"><span class="built_in">echo</span>   <span class="number">100</span>%%</span><br><span class="line"><span class="built_in">echo</span>  └──────────────────────────────────────┘</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>解说：“set /p a=■&lt;nul”的意思是：只显示提示信息“■”且不换行，也不需手工输入任何信息，这样可以使每个“■”在同一行逐个输出。“ping /n 0 127.1&gt;nul”是输出每个“■”的时间间隔，即每隔多少时间输出一个“■”。</p>
<p>运行结果：</p>
<figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"> 程序正在初始化. . .</span><br><span class="line"></span><br><span class="line"> ┌──────────────────────────────────────┐</span><br><span class="line">■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  <span class="number">100</span>%</span><br><span class="line"> └──────────────────────────────────────┘</span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure>
<h3 id="十一-特殊字符的输入及应用"><a href="#十一-特殊字符的输入及应用" class="headerlink" title="十一. 特殊字符的输入及应用"></a>十一. 特殊字符的输入及应用</h3><p>开始 -&gt; 运行 -&gt; 输入cmd -&gt; edit -&gt; ctrl+p（意思是允许输入特殊字符）-&gt; 按ctrl+a将会显示笑脸图案。</p>
<p>（如果要继续输入特殊字符请再次按ctrl+p，然后ctrl+某个字母）</p>
<p>以上是特殊字符的输入方法，选自[英雄]教程，很管用的。也就是用编辑程序edit输入特殊字符，然后保存为一文本文件，再在windows下打开此文件，复制其中的特殊符号即可。</p>
<p>一些简单的特殊符号可以在dos命令窗口直接输入，并用重定向保存为文本文件。<br>例：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">C:&gt;<span class="title">ECHO</span> ^<span class="title">G</span>&gt;<span class="title">temp.txt</span></span></span><br></pre></td></tr></table></figure></p>
<p>“^G”是用Ctrl＋G或Alt＋007输入，输入多个^G可以产生多声鸣响。</p>
<p>特殊字符的应用也很有意思，这里仅举一例：退格键</p>
<p>退格键表示删除左边的字符，此键不能在文档中正常输入，但可以通过edit编辑程序录入并复制出来。即“”。</p>
<p>利用退格键，可以设计闪烁文字效果</p>
<p>例：文字闪烁<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line">:<span class="built_in">start</span></span><br><span class="line"><span class="built_in">set</span>/p=床前明月光&lt;<span class="built_in">nul</span></span><br><span class="line">::显示文字，光标停于行尾</span><br><span class="line"><span class="built_in">ping</span> -n <span class="number">0</span> <span class="number">127</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">1</span>&gt;<span class="built_in">nul</span></span><br><span class="line">::设置延迟时间</span><br><span class="line"><span class="built_in">set</span> /p a=&lt;<span class="built_in">nul</span></span><br><span class="line">:: 输出一些退格符将光标置于该行的最左端（退格符的数量可以自己调整）。</span><br><span class="line"><span class="built_in">set</span> /p a=                               &lt;<span class="built_in">nul</span></span><br><span class="line">::输出空格将之前输出的文字覆盖掉。</span><br><span class="line"><span class="built_in">set</span> /p a=&lt;<span class="built_in">nul</span></span><br><span class="line">::再次输出退格符将光标置于该行的最左端，这里的退格符数量一定不能比前面的空格数少。</span><br><span class="line">::否则光标不能退到最左端。</span><br><span class="line"><span class="keyword">goto</span> <span class="built_in">start</span></span><br></pre></td></tr></table></figure></p>
<p>例：输出唐诗一首，每行闪动多次<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">setlocal</span> enabledelayedexpansion</span><br><span class="line"></span><br><span class="line"><span class="built_in">set</span> str=床前明月光 疑是地上霜 举头望明月 低头思故乡</span><br><span class="line">::定义字符串str</span><br><span class="line"><span class="keyword">for</span> <span class="variable">%%i</span> <span class="keyword">in</span> (<span class="variable">%str%</span>) <span class="keyword">do</span> (</span><br><span class="line"><span class="comment"> rem 由于str中含有空格，则以空格为分隔符将str中的每一个部分依次赋给变量%%i。</span></span><br><span class="line">        <span class="built_in">set</span> char=<span class="variable">%%i</span></span><br><span class="line">        <span class="built_in">echo</span>.</span><br><span class="line">        <span class="built_in">echo</span>.</span><br><span class="line">        <span class="keyword">for</span> /l <span class="variable">%%j</span> <span class="keyword">in</span> (<span class="number">0</span>,<span class="number">1</span>,<span class="number">5</span>) <span class="keyword">do</span> (</span><br><span class="line">                <span class="built_in">set</span>/p=<span class="variable">!char:~%%j,1!</span>&lt;<span class="built_in">nul</span></span><br><span class="line"><span class="comment">  rem 依次取出变量char中的每一个字符，并显示。</span></span><br><span class="line">                <span class="built_in">ping</span> -n <span class="number">0</span> <span class="number">127</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">1</span>&gt;<span class="built_in">nul</span></span><br><span class="line"><span class="comment">  rem 设置输出每个字符的时间延迟。</span></span><br><span class="line">        )</span><br><span class="line"> <span class="keyword">call</span> :hero <span class="variable">%%i</span></span><br><span class="line">)</span><br><span class="line"><span class="built_in">pause</span>&gt;<span class="built_in">nul</span></span><br><span class="line"><span class="keyword">exit</span></span><br><span class="line"></span><br><span class="line">:hero</span><br><span class="line"><span class="keyword">for</span> /l <span class="variable">%%k</span> <span class="keyword">in</span> (<span class="number">1</span>,<span class="number">1</span>,<span class="number">10</span>) <span class="keyword">do</span> (</span><br><span class="line"> <span class="built_in">ping</span> /n <span class="number">0</span> <span class="number">127</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">1</span>&gt;<span class="built_in">nul</span></span><br><span class="line"> <span class="built_in">set</span> /p a=&lt;<span class="built_in">nul</span></span><br><span class="line"> <span class="built_in">set</span> /p a=                               &lt;<span class="built_in">nul</span></span><br><span class="line"> <span class="built_in">set</span> /p a=&lt;<span class="built_in">nul</span></span><br><span class="line"> <span class="built_in">ping</span> /n <span class="number">0</span> <span class="number">127</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">1</span>&gt;<span class="built_in">nul</span></span><br><span class="line"> <span class="built_in">set</span> /p a=%<span class="number">1</span>&lt;<span class="built_in">nul</span></span><br><span class="line">)</span><br><span class="line">::文字闪动</span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<h3 id="十二-随机数（-random-）的应用技巧"><a href="#十二-随机数（-random-）的应用技巧" class="headerlink" title="十二. 随机数（%random%）的应用技巧"></a>十二. 随机数（%random%）的应用技巧</h3><p>%RANDOM% 系统变量 返回 0 到 32767 之间的任意十进制数字。由 Cmd.exe 生成。</p>
<p>2的15次方等于32768，上面的0～32767实际就是15位二进制数的范围。</p>
<p>那么，如何获取100以内的随机数呢？很简单，将%RANDOM%按100进行求余运算即可，见例子。</p>
<p>例：生成5个100以内的随机数<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">setlocal</span> enabledelayedexpansion</span><br><span class="line"><span class="keyword">for</span> /L <span class="variable">%%i</span> <span class="keyword">in</span> (<span class="number">1</span> <span class="number">1</span> <span class="number">5</span>) <span class="keyword">do</span> (</span><br><span class="line">   <span class="built_in">set</span> /a randomNum=<span class="variable">!random!</span><span class="variable">%%1</span>00</span><br><span class="line">   <span class="built_in">echo</span> 随机数：<span class="variable">!randomNum!</span></span><br><span class="line">)</span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行结果：（每次运行不一样）<br>随机数：91<br>随机数：67<br>随机数：58<br>随机数：26<br>随机数：20<br>请按任意键继续. . .</p>
<p>求余数运算set /a randomNum=!random!%%100中的100可以是1～32768之间的任意整数。</p>
<p>总结：利用系统变量%random%，求余数运算%%，字符串处理等，可以实现很多随机处理。</p>
<p>思考题目：生成给定位数的随机密码<br>解答思路：将26个英文字母或10数字以及其它特殊字符组成一个字符串，随机抽取其中的若干字符。</p>
<p>参考答案1：（简单）<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">call</span> :randomPassword <span class="number">5</span> pass1 pass2</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%pass1%</span> <span class="variable">%pass2%</span> </span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"><span class="keyword">exit</span></span><br><span class="line"></span><br><span class="line">:randomPassword</span><br><span class="line">::---------生成随机密码</span><br><span class="line">::---------<span class="variable">%1为密码长度，%</span><span class="number">2</span>及以后为返回变量名称</span><br><span class="line">::---------<span class="keyword">for</span>命令最多只能区分<span class="number">31</span>个字段</span><br><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> password_len=%<span class="number">1</span></span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> <span class="keyword">defined</span> password_len <span class="keyword">goto</span> :eof</span><br><span class="line"><span class="keyword">if</span> <span class="variable">%password_len%</span> <span class="keyword">lss</span> <span class="number">1</span> <span class="keyword">goto</span> :eof</span><br><span class="line"><span class="built_in">set</span> wordset=a b c d e f g h i j k l m n o p q r s t u v w x y z</span><br><span class="line"><span class="built_in">set</span> return=</span><br><span class="line"><span class="built_in">set</span> num=<span class="number">0</span></span><br><span class="line">:randomPassword1</span><br><span class="line"><span class="built_in">set</span> /a num+=<span class="number">1</span></span><br><span class="line"><span class="built_in">set</span> /a numof=<span class="variable">%random%</span><span class="variable">%%2</span>6+<span class="number">1</span></span><br><span class="line"><span class="keyword">for</span> /f "tokens=<span class="variable">%numof%</span> delims= " <span class="variable">%%i</span> <span class="keyword">in</span> ("<span class="variable">%wordset%</span>") <span class="keyword">do</span> <span class="built_in">set</span> return=<span class="variable">%return%</span><span class="variable">%%i</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%num%</span> <span class="keyword">lss</span> <span class="variable">%password_len%</span> <span class="keyword">goto</span> randomPassword1</span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> "%<span class="number">2</span>"=="" <span class="built_in">set</span> <span class="variable">%2=%</span>return%</span><br><span class="line"><span class="built_in">shift</span> /<span class="number">2</span></span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> "%<span class="number">2</span>"=="" <span class="keyword">goto</span> randomPassword</span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<p>参考答案2：（最优）<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">call</span> :randomPassword <span class="number">6</span> pass1 pass2 pass3</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%pass1%</span> <span class="variable">%pass2%</span> <span class="variable">%pass3%</span></span><br><span class="line"><span class="built_in">pause</span></span><br><span class="line"><span class="keyword">exit</span></span><br><span class="line"></span><br><span class="line">:randomPassword</span><br><span class="line">::---------生成随机密码</span><br><span class="line">::---------<span class="variable">%1为密码长度，%</span><span class="number">2</span>及以后为返回变量名称</span><br><span class="line">::---------<span class="keyword">goto</span>循环. 变量嵌套. 命令嵌套</span><br><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="keyword">if</span> "%<span class="number">1</span>"=="" <span class="keyword">goto</span> :eof</span><br><span class="line"><span class="keyword">if</span> %<span class="number">1</span> <span class="keyword">lss</span> <span class="number">1</span> <span class="keyword">goto</span> :eof</span><br><span class="line"><span class="built_in">set</span> password_len=%<span class="number">1</span></span><br><span class="line"><span class="built_in">set</span> return=</span><br><span class="line"><span class="built_in">set</span> wordset=abcdefghijklmnopqrstuvwxyz023456789_</span><br><span class="line">::---------------------------循环</span><br><span class="line">:randomPassword1</span><br><span class="line"><span class="built_in">set</span> /a numof=<span class="variable">%random%</span><span class="variable">%%3</span>6</span><br><span class="line"><span class="keyword">call</span> <span class="built_in">set</span> return=<span class="variable">%return%</span><span class="variable">%%w</span>ordset:~<span class="variable">%numof%</span>,<span class="number">1</span>%%</span><br><span class="line"><span class="built_in">set</span> /a password_len-=<span class="number">1</span></span><br><span class="line"><span class="keyword">if</span> <span class="variable">%password_len%</span> <span class="keyword">gtr</span> <span class="number">0</span> <span class="keyword">goto</span> randomPassword1</span><br><span class="line">::---------------------------循环</span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> "%<span class="number">2</span>"=="" <span class="built_in">set</span> <span class="variable">%2=%</span>return%</span><br><span class="line"><span class="built_in">shift</span> /<span class="number">2</span></span><br><span class="line"><span class="keyword">if</span> <span class="keyword">not</span> "%<span class="number">2</span>"=="" <span class="keyword">goto</span> randomPassword</span><br><span class="line"><span class="keyword">goto</span> :eof</span><br></pre></td></tr></table></figure></p>
<p>说明：本例涉及到变量嵌套和命令嵌套的应用，见后。</p>
<h3 id="十三-变量嵌套-与-命令嵌套"><a href="#十三-变量嵌套-与-命令嵌套" class="headerlink" title="十三. 变量嵌套 与 命令嵌套"></a>十三. 变量嵌套 与 命令嵌套</h3><p>和其它编程语言相比，dos功能显得相对简单，要实现比较复杂的功能，需要充分运用各种技巧，变量嵌套与命令嵌套就是此类技巧之一。</p>
<p>先复习一下前面的“字符串截取”的关键内容：</p>
<p>截取功能统一语法格式为：<code>%a:~[m[,n]]%</code></p>
<p>方括号表示可选，%为变量标识符，a为变量名，不可少，冒号用于分隔变量名和说明部分，符号～可以简单理解为“偏移”即可，m为偏移量（缺省为0），n为截取长度（缺省为全部）。</p>
<p>百分号如果需要当成单一字符，必须写成%%</p>
<p>以上是dos变量处理的通用格式，如果其中的m. n为变量，那么这种情况就是变量嵌套了。</p>
<p>比如设变量word为“abcdefghij”，变量num为“eee4eeeee”<br><code>%word:~4,1%</code>为e，其中4可以从变量num中取值，即<code>%num:~3,1%</code>，写成组合形式如下：<br><code>%word:~%num:~3,1%,1%</code> 经测试这种写法不能正确执行，那么，怎么实现这种变量嵌套呢？首先，我们将其中的<code>%num:~3,1%</code>作为正常的字符处理命令，其它部分当成一般字符串，这样首尾的%就必须写成%%了，即<code>%%word:~%num:~3,1%,1%%</code><br>但是上面的写法同样不能直接当成命令执行，必须运用命令嵌套才能执行。</p>
<p>什么是命令嵌套呢？简单的说，首先用一条dos命令生成一个字符串，而这个字符串是另一条dos命令，用call语句调用字符串将其执行，从而得到最终结果。</p>
<p>例：用call语句实现命令嵌套<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="built_in">set</span> str1=aaa <span class="built_in">echo</span> ok bbb</span><br><span class="line"><span class="built_in">echo</span> 初始字符串：<span class="variable">%str1%</span></span><br><span class="line"><span class="built_in">echo</span> 生成命令字符串如下：</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%str1:~4,7%</span></span><br><span class="line"><span class="built_in">echo</span> 运行命令字符串生成最终结果为：</span><br><span class="line"><span class="keyword">call</span> <span class="variable">%str1:~4,7%</span></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<p>运行显示：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">初始字符串：aaa <span class="built_in">echo</span> ok bbb</span><br><span class="line">生成命令字符串如下：</span><br><span class="line"><span class="built_in">echo</span> ok</span><br><span class="line">运行命令字符串生成最终结果为：</span><br><span class="line">ok</span><br><span class="line">请按任意键继续. . .</span><br></pre></td></tr></table></figure></p>
<p>变量嵌套与命令嵌套结合运用，见下例。<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"></span><br><span class="line"><span class="built_in">set</span> num=Redtek <span class="number">2006</span> bbs.cn-dos.<span class="built_in">net</span></span><br><span class="line"><span class="built_in">set</span> a=<span class="number">123245</span></span><br><span class="line"><span class="built_in">set</span> b=<span class="number">87754321</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span>.</span><br><span class="line"><span class="built_in">echo</span> a=<span class="variable">%a%</span>  b=<span class="variable">%b%</span>  num=<span class="variable">%num%</span></span><br><span class="line"><span class="built_in">set</span> result=<span class="variable">%%%</span><span class="variable">%%%</span><span class="variable">%%n</span>um:~<span class="variable">%%%</span><span class="variable">%b:~%</span>a:~<span class="number">3</span>,<span class="number">1</span><span class="variable">%,1%</span><span class="variable">%%%</span>,<span class="number">4</span><span class="variable">%%%</span><span class="variable">%%%</span>%%</span><br><span class="line"><span class="built_in">echo</span> 直接运行命令，只解析第一层变量，其余的当作字符串：<span class="variable">%result%</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">call</span> <span class="built_in">set</span> result=<span class="variable">%%%</span><span class="variable">%%%</span><span class="variable">%%n</span>um:~<span class="variable">%%%</span><span class="variable">%b:~%</span>a:~<span class="number">3</span>,<span class="number">1</span><span class="variable">%,1%</span><span class="variable">%%%</span>,<span class="number">4</span><span class="variable">%%%</span><span class="variable">%%%</span>%%</span><br><span class="line"><span class="built_in">echo</span> 一层命令嵌套，可解析两层变量，其余的当作字符串：<span class="variable">%result%</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">call</span> <span class="keyword">call</span> <span class="built_in">set</span> result=<span class="variable">%%%</span><span class="variable">%%%</span><span class="variable">%%n</span>um:~<span class="variable">%%%</span><span class="variable">%b:~%</span>a:~<span class="number">3</span>,<span class="number">1</span><span class="variable">%,1%</span><span class="variable">%%%</span>,<span class="number">4</span><span class="variable">%%%</span><span class="variable">%%%</span>%%</span><br><span class="line"><span class="built_in">echo</span> 两层命令嵌套，可解析三层变量，其余的当作字符串：<span class="variable">%result%</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">call</span> <span class="keyword">call</span> <span class="keyword">call</span> <span class="built_in">set</span> result=<span class="variable">%%%</span><span class="variable">%%%</span><span class="variable">%%n</span>um:~<span class="variable">%%%</span><span class="variable">%b:~%</span>a:~<span class="number">3</span>,<span class="number">1</span><span class="variable">%,1%</span><span class="variable">%%%</span>,<span class="number">4</span><span class="variable">%%%</span><span class="variable">%%%</span>%%</span><br><span class="line"><span class="built_in">echo</span> 三层命令嵌套，运行变量解析完后的字符串：<span class="variable">%result%</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">pause</span></span><br></pre></td></tr></table></figure></p>
<h3 id="十四-文件内容筛选（type和findstr命令结合使用）"><a href="#十四-文件内容筛选（type和findstr命令结合使用）" class="headerlink" title="十四. 文件内容筛选（type和findstr命令结合使用）"></a>十四. 文件内容筛选（type和findstr命令结合使用）</h3><p>Find常和type命令结合使用<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">Type</span> [drive:][<span class="built_in">path</span>]filename | <span class="built_in">find</span> "string" [&gt;tmpfile] #挑选包含string的行</span><br><span class="line"><span class="built_in">Type</span> [drive:][<span class="built_in">path</span>]filename | <span class="built_in">find</span> /v "string"   #剔除文件中包含string的行</span><br><span class="line"><span class="built_in">Type</span> [drive:][<span class="built_in">path</span>]filename | <span class="built_in">find</span> /c   #显示文件行数</span><br></pre></td></tr></table></figure></p>
<p>以上用法将去除find命令自带的提示语（文件名提示）<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">FIND</span> [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][<span class="built_in">path</span>]filename[ ...]]</span><br><span class="line"></span><br><span class="line">  /V        显示所有未包含指定字符串的行。</span><br><span class="line">  /C        仅显示包含字符串的行数。</span><br><span class="line">  /N        显示行号。</span><br><span class="line">  /I        搜索字符串时忽略大小写。</span><br><span class="line">  /OFF[LINE] 不要跳过具有脱机属性集的文件。</span><br><span class="line">  "string"  指定要搜索的文字串，</span><br><span class="line">  [drive:][<span class="built_in">path</span>]filename</span><br><span class="line">            指定要搜索的文件。</span><br></pre></td></tr></table></figure></p>
<p>如果没有指定路径，FIND 将搜索键入的或者由另一命令产生的文字。</p>
<p>find命令不能处理文件中超过1024个字符的数据行，此时可用findstr命令。（见前面介绍）<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">FINDSTR</span> [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/F:file]</span><br><span class="line">        [/C:string] [/G:file] [/D:<span class="built_in">dir</span> list] [/A:<span class="built_in">color</span> attributes] [/OFF[LINE]]</span><br><span class="line">        strings [[drive:][<span class="built_in">path</span>]filename[ ...]]</span><br><span class="line"></span><br><span class="line">  /B        在一行的开始配对模式。</span><br><span class="line">  /E        在一行的结尾配对模式。</span><br><span class="line">  /L        按字使用搜索字符串。</span><br><span class="line">  /R        将搜索字符串作为一般表达式使用。</span><br><span class="line">  /S        在当前目录和所有子目录中搜索</span><br><span class="line">              匹配文件。</span><br><span class="line">  /I         指定搜索不分大小写。</span><br><span class="line">  /X        打印完全匹配的行。</span><br><span class="line">  /V        只打印不包含匹配的行。</span><br><span class="line">  /N        在匹配的每行前打印行数。</span><br><span class="line">  /M        如果文件含有匹配项，只打印其文件名。</span><br><span class="line">  /O        在每个匹配行前打印字符偏移量。</span><br><span class="line">  /P        忽略有不可打印字符的文件。</span><br><span class="line">  /OFF[LINE] 不跳过带有脱机属性集的文件。</span><br><span class="line">  /A:attr   指定有十六进位数字的颜色属性。请见 "<span class="built_in">color</span> /?"</span><br><span class="line">  /F:file   从指定文件读文件列表 (/ 代表控制台)。</span><br><span class="line">  /C:string 使用指定字符串作为文字搜索字符串。</span><br><span class="line">  /G:file   从指定的文件获得搜索字符串。 (/ 代表控制台)。</span><br><span class="line">  /D:<span class="built_in">dir</span>    查找以分号为分隔符的目录列表</span><br><span class="line">  strings   要查找的文字。</span><br><span class="line">  [drive:][<span class="built_in">path</span>]filename</span><br><span class="line">            指定要查找的文件。</span><br></pre></td></tr></table></figure></p>
<p>除非参数有 /C 前缀，请使用空格隔开搜索字符串。<br>例如： <code>FINDSTR &quot;hello there&quot; x.y</code> 在文件 <code>x.y</code> 中寻找 “hello” 或<br>“there” 。  <code>FINDSTR /C:&quot;hello there&quot; x.y</code> 在文件 <code>x.y</code>  中寻找<br>“hello there”。</p>
<p>一般表达式的快速参考：<br><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">.        通配符: 任何字符</span><br><span class="line">*        重复: 以前字符或类别出现零或零以上次数</span><br><span class="line">^        行位置: 行的开始</span><br><span class="line">$        行位置: 行的终点</span><br><span class="line">[class]  字符类别: 任何在字符集中的字符</span><br><span class="line">[^class] 补字符类别: 任何不在字符集中的字符</span><br><span class="line">[x-y]    范围: 在指定范围内的任何字符</span><br><span class="line">\x       Escape: 元字符 x 的文字用法</span><br><span class="line">\&lt;xyz    字位置: 字的开始</span><br><span class="line">xyz\&gt;    字位置: 字的结束</span><br></pre></td></tr></table></figure></p>
<p>有关 FINDSTR 常见表达法的详细情况，请见联机命令参考。</p>
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>本教程主要引用伤脑筋版主的系列文章，同时参考引用[英雄]教程等其他批处理教程，本文将这些文章合并在一起，并尽量修改得详细而且简单易懂，修改整理也是学习过程，主要目的是方便自己以后查阅。</p>
<p>本教程很长啊，需要一定的耐心才能看完，能够看完的话，差不多就是批处理高手了，即使不是高手也是熟手了。本教程还在不断补充之中，当有比较典型的应用技巧时，本教材会将其收入相关的章节之中。本教程适合对dos有一定基础的人慢慢学习或查阅。</p>
<p><strong>查阅方法：在 阅读全文 页面 复制目录中的条目，搜索即可。或点右下角的目录链接</strong></p>
<p>整理者邮箱：<a href="xiangkg@163.com">xiangkg@163.com</a>，如果你要全文或有好的dos使用经验，请你发email给我，谢谢！</p>
<p> 全文：<a href="http://xiangkg.blog.163.com/" target="_blank" rel="noopener">http://xiangkg.blog.163.com</a></p>
<ol>
<li>更正了所有的错别字，适当排版，增加条理性。</li>
<li>运行改善所有例子，并纠正了一些语法错误。</li>
<li>补充了一些不完全的地方。</li>
<li>第一章参考了网上许多教程汇编而成。</li>
<li>20080229补充了变量延迟的问题。</li>
<li>20080305修改了参数usebackq的说明</li>
<li>20080310增加了特殊字符的输入及应用</li>
<li>20080311修改了子程序部分</li>
<li>20080313修改了echo说明，归纳了9个应用方法</li>
<li>20080320增加任意时间延迟方法</li>
<li>20080321增加了set计算中十进制与八进制混淆问题的说明</li>
<li>20080325修正dos数值计算范围：-2147483648至2147483647，即-2^31～2^31-1</li>
<li>20080326增加随机数的应用</li>
<li>20080327修改了“if增强用法”中的defined语句说明</li>
<li><p>20080402增加变量嵌套与命令嵌套，重要技巧之一。</p>
<p>不断学习中，不断更新中。</p>
</li>
</ol>
<h2 id="目录"><a href="#目录" class="headerlink" title="目录"></a>目录</h2><p>（无链接，带链接功能的目录在页面右下角）</p>
<p>第一章 批处理基础<br> 第一节 常用批处理内部命令简介</p>
<ol>
<li>REM 和 <code>::</code> 注释</li>
<li>ECHO 和 @</li>
<li>PAUSE 暂停</li>
<li>ERRORLEVEL</li>
<li>TITLE 设置cmd窗口的标题</li>
<li>COLOR 设置cmd窗口前景和背景颜色</li>
<li>mode 配置系统设备</li>
<li>GOTO 和 <code>:</code></li>
<li>FIND 在文件中搜索字符串</li>
<li>START 调用外部程序并任其在新窗口自行运行</li>
<li>assoc 和 ftype</li>
<li>pushd 和 popd</li>
<li>CALL 调用批处理程序或命令并等待其执行完毕</li>
<li>shift</li>
<li>IF</li>
<li>setlocal 与 变量延迟</li>
<li>ATTRIB  显示或更改文件属性</li>
<li>findstr 在文件中搜索字符串（find增强版）</li>
<li><code>date /t</code> 和 <code>time /t</code><br>第二节 常用特殊符号</li>
<li><code>@</code>  命令行回显屏蔽符</li>
<li><code>%</code>  批处理变量引导符</li>
<li><code>&gt;</code>  输出重定向符</li>
<li><code>&gt;&gt;</code>  输出重定向符</li>
<li><code>&lt;. &gt;&amp;. &lt;&amp;</code> 重定向符</li>
<li><code>|</code>  命令管道符</li>
<li><code>^</code>  转义字符</li>
<li><code>&amp;</code>  组合命令（顺序执行）</li>
<li><code>&amp;&amp;</code> 组合命令（前面指令成功，才执行后面指令）</li>
<li><code>||</code>  组合命令（前面指令失败，才执行后面指令）</li>
<li><code>&quot;&quot;</code>  字符串界定符</li>
<li><code>,</code> 逗号</li>
<li><code>;</code> 分号</li>
<li><code>()</code> 括号</li>
<li><code>!</code> 感叹号</li>
<li>批处理中可能会见到的其它特殊标记符 （略）<br>  <code>CR(0D)</code> 命令行结束符<br>  <code>Escape(1B)</code> ANSI转义字符引导符<br>  <code>Space(20)</code> 常用的参数界定符<br>  <code>Tab(09) ; =</code> 不常用的参数界定符<br>  <code>+ COPY</code>命令文件连接符<br>  <code>* ?</code> 文件通配符<br>  <code>/</code> 参数开关引导符<br>  <code>:</code>批处理标签引导符</li>
</ol>
<p>第二章 FOR命令详解</p>
<ol>
<li>基本格式</li>
<li>参数 /d 主要搜索匹配目录</li>
<li>参数 /R 搜索指定目录树中的匹配文件</li>
<li>参数 /L 按数字序列(start,step,end)循环</li>
<li>参数 /F 处理命令输出. 字符串及文件内容</li>
</ol>
<p>第三章 FOR命令中的变量</p>
<ol>
<li>~I          - 删除任何引号(“)，扩展 %I</li>
<li>%~fI        - 将 %I 扩展到一个完全合格的路径名</li>
<li>%~dI        - 仅将 %I 扩展到一个驱动器号</li>
<li>%~pI        - 仅将 %I 扩展到一个路径</li>
<li>%~nI        - 仅将 %I 扩展到一个文件名</li>
<li>%~xI        - 仅将 %I 扩展到一个文件扩展名</li>
<li>%~sI        - 扩展的路径只含有短名</li>
<li>%~aI        - 将 %I 扩展到文件的文件属性</li>
<li>%~tI        - 将 %I 扩展到文件的日期/时间</li>
<li>%~zI        - 将 %I 扩展到文件的大小</li>
<li><code>%~$PATH:I</code></li>
</ol>
<p>第四章 批处理中的变量</p>
<ol>
<li>系统变量</li>
<li>自定义变量</li>
</ol>
<p>第五章 set命令详解</p>
<ol>
<li>用set命令设置自定义变量</li>
<li>用set命令进行简单计算</li>
<li>用set命令进行字符串处理<ol>
<li>字符串替换</li>
<li>字符串截取</li>
</ol>
</li>
</ol>
<p>第六章 if命令讲解<br> 第一种用法：IF [NOT] ERRORLEVEL number command<br> 第二种用法：IF [NOT] string1==string2 command<br> 第三种用法：IF [NOT] EXIST filename command<br> 第四种用法：IF增强的用法</p>
<p>第七章 DOS编程高级技巧</p>
<ol>
<li>交互界面设计</li>
<li>if…else…条件语句</li>
<li>循环语句</li>
<li>子程序</li>
<li>用ftp命令实现自动下载</li>
<li>用7-ZIP实现命令行压缩和解压功能</li>
<li>调用VBScript程序</li>
<li>将批处理转化为可执行文件</li>
<li>时间延迟<ol>
<li>利用ping命令延时</li>
<li>利用for命令延时</li>
<li>利用vbs延迟函数，精确度毫秒，误差1000毫秒内</li>
<li>仅用批处理命令实现任意时间延迟，精确度10毫秒，误差50毫秒内</li>
</ol>
</li>
<li>模拟进度条</li>
<li>特殊字符的输入及应用</li>
<li>随机数（%random%）的应用技巧</li>
<li>变量嵌套 与 命令嵌套</li>
<li>文件内容筛选（type和findstr命令结合使用）</li>
</ol>

      

      
    </div>
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<i class="icon-price-tags icon"></i>
		<ul class="article-tag-list">
			 
        		<li class="article-tag-list-item">
        			<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">BAT</a>
        		</li>
      		 
        		<li class="article-tag-list-item">
        			<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">批处理</a>
        		</li>
      		 
        		<li class="article-tag-list-item">
        			<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">CMD</a>
        		</li>
      		
		</ul>
	</div>

      

      

      
        
<div class="share-btn share-icons tooltip-left">
  <div class="tooltip tooltip-east">
    <span class="tooltip-item">
      <a href="javascript:;" class="share-sns share-outer">
        <i class="icon icon-share"></i>
      </a>
    </span>
    <span class="tooltip-content">
      <div class="share-wrap">
        <div class="share-icons">
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="icon icon-weibo"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="icon icon-weixin"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="icon icon-qq"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="icon icon-douban"></i>
          </a>
          <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a>
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="icon icon-facebook"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="icon icon-twitter"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="icon icon-google"></i>
          </a>
        </div>
      </div>
    </span>
  </div>
</div>

<div class="page-modal wx-share js-wx-box">
    <a class="close js-modal-close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="http://s.jiathis.com/qrcode.php?url=http:maode.github.io/2018/02/18/180218-BAT-tutorial/" alt="微信分享二维码">
    </div>
</div>

<div class="mask js-mask"></div>
      
      <div class="clearfix"></div>
    </div>
  </div>
</article>

  
<nav id="article-nav">
  
    <a href="/2018/02/19/180219-Spring-cache/" id="article-nav-newer" class="article-nav-link-wrap">
      <i class="icon-circle-left"></i>
      <div class="article-nav-title">
        
          缓存以及Spring cache介绍
        
      </div>
    </a>
  
  
    <a href="/2018/02/17/180217-lombok-install/" id="article-nav-older" class="article-nav-link-wrap">
      <div class="article-nav-title">lombok配置过程</div>
      <i class="icon-circle-right"></i>
    </a>
  
</nav>


<aside class="wrap-side-operation">
    <div class="mod-side-operation">
        
        <div class="jump-container" id="js-jump-container" style="display:none;">
            <a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
                <i class="icon-font icon-back"></i>
            </a>
            <div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
                <i class="icon-font icon-plane jump-plane"></i>
            </div>
        </div>
        
        
        <div class="toc-container tooltip-left">
            <i class="icon-font icon-category"></i>
            <div class="tooltip tooltip-east">
                <span class="tooltip-item">
                </span>
                <span class="tooltip-content">
                    <div class="toc-article">
                    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#第一章-批处理基础"><span class="toc-number">1.</span> <span class="toc-text">第一章 批处理基础</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#第一节-常用批处理内部命令简介"><span class="toc-number">1.1.</span> <span class="toc-text">第一节 常用批处理内部命令简介</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#REM-和"><span class="toc-number">1.1.1.</span> <span class="toc-text">REM 和 ::</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#ECHO-和"><span class="toc-number">1.1.2.</span> <span class="toc-text">ECHO 和 @</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#PAUSE-暂停"><span class="toc-number">1.1.3.</span> <span class="toc-text">PAUSE 暂停</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#errorlevel-程序返回码"><span class="toc-number">1.1.4.</span> <span class="toc-text">errorlevel  程序返回码</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#title-设置cmd窗口的标题"><span class="toc-number">1.1.5.</span> <span class="toc-text">title 设置cmd窗口的标题</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#COLOR-设置cmd窗口前景和背景颜色"><span class="toc-number">1.1.6.</span> <span class="toc-text">COLOR 设置cmd窗口前景和背景颜色</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#mode-配置系统设备"><span class="toc-number">1.1.7.</span> <span class="toc-text">mode 配置系统设备</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#GOTO-和"><span class="toc-number">1.1.8.</span> <span class="toc-text">GOTO 和 :</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#find-在文件中搜索字符串"><span class="toc-number">1.1.9.</span> <span class="toc-text">find 在文件中搜索字符串</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#start-调用外部程序并任其在新窗口自行运行"><span class="toc-number">1.1.10.</span> <span class="toc-text">start 调用外部程序并任其在新窗口自行运行</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#assoc-和-ftype"><span class="toc-number">1.1.11.</span> <span class="toc-text">assoc 和 ftype</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#pushd-和-popd"><span class="toc-number">1.1.12.</span> <span class="toc-text">pushd 和 popd</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#CALL-调用批处理程序或命令并等待其执行完毕"><span class="toc-number">1.1.13.</span> <span class="toc-text">CALL 调用批处理程序或命令并等待其执行完毕</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#shift"><span class="toc-number">1.1.14.</span> <span class="toc-text">shift</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#IF"><span class="toc-number">1.1.15.</span> <span class="toc-text">IF</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#setlocal-与-变量延迟"><span class="toc-number">1.1.16.</span> <span class="toc-text">setlocal 与 变量延迟</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#ATTRIB-显示或更改文件属性"><span class="toc-number">1.1.17.</span> <span class="toc-text">ATTRIB  显示或更改文件属性</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#findstr-在文件中搜索字符串（find增强版）"><span class="toc-number">1.1.18.</span> <span class="toc-text">findstr 在文件中搜索字符串（find增强版）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#date-t-和-time-t"><span class="toc-number">1.1.19.</span> <span class="toc-text">date /t 和 time /t</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#第二节-常用特殊符号"><span class="toc-number">1.2.</span> <span class="toc-text">第二节 常用特殊符号</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#命令行回显屏蔽符"><span class="toc-number">1.2.1.</span> <span class="toc-text">@  命令行回显屏蔽符</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#批处理变量引导符"><span class="toc-number">1.2.2.</span> <span class="toc-text">%  批处理变量引导符</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#gt-输出重定向符"><span class="toc-number">1.2.3.</span> <span class="toc-text">&gt;   输出重定向符</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#gt-gt-输出重定向符"><span class="toc-number">1.2.4.</span> <span class="toc-text">&gt;&gt;  输出重定向符</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#lt-gt-amp-lt-amp-重定向符"><span class="toc-number">1.2.5.</span> <span class="toc-text">&lt; &gt;&amp; &lt;&amp; 重定向符</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#命令管道符"><span class="toc-number">1.2.6.</span> <span class="toc-text">|  命令管道符</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#转义字符"><span class="toc-number">1.2.7.</span> <span class="toc-text">^  转义字符</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#amp-组合命令（顺序执行）"><span class="toc-number">1.2.8.</span> <span class="toc-text">&amp;  组合命令（顺序执行）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#amp-amp-组合命令（前面指令成功，才执行后面指令）"><span class="toc-number">1.2.9.</span> <span class="toc-text">&amp;&amp; 组合命令（前面指令成功，才执行后面指令）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#组合命令（前面指令失败，才执行后面指令）"><span class="toc-number">1.2.10.</span> <span class="toc-text">||  组合命令（前面指令失败，才执行后面指令）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#quot-quot-字符串界定符"><span class="toc-number">1.2.11.</span> <span class="toc-text">&quot;&quot;  字符串界定符</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#逗号"><span class="toc-number">1.2.12.</span> <span class="toc-text">, 逗号</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#分号"><span class="toc-number">1.2.13.</span> <span class="toc-text">; 分号</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#小括号"><span class="toc-number">1.2.14.</span> <span class="toc-text">() 小括号</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#感叹号"><span class="toc-number">1.2.15.</span> <span class="toc-text">! 感叹号</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#批处理中可能会见到的其它特殊标记符-（略）"><span class="toc-number">1.2.16.</span> <span class="toc-text">批处理中可能会见到的其它特殊标记符: （略）</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第二章-FOR命令详解"><span class="toc-number">2.</span> <span class="toc-text">第二章 FOR命令详解</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#基本格式"><span class="toc-number">2.1.</span> <span class="toc-text">基本格式</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#参数-d-主要搜索匹配目录"><span class="toc-number">2.2.</span> <span class="toc-text">参数 /d (主要搜索匹配目录)</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#参数-R-（搜索指定目录树中的匹配文件）"><span class="toc-number">2.3.</span> <span class="toc-text">参数 /R （搜索指定目录树中的匹配文件）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#参数-L-（按数字序列-start-step-end-循环）"><span class="toc-number">2.4.</span> <span class="toc-text">参数 /L （按数字序列 start,step,end 循环）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#参数-F-（处理-命令输出，字符串及文件内容）"><span class="toc-number">2.5.</span> <span class="toc-text">参数 /F （处理 命令输出，字符串及文件内容）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第三章-FOR命令中的变量"><span class="toc-number">3.</span> <span class="toc-text">第三章 FOR命令中的变量</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#I-删除任何引号-“-，扩展-I"><span class="toc-number">3.1.</span> <span class="toc-text">~I 删除任何引号(“)，扩展 %I</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#fI-将-I-扩展到一个完全合格的路径名"><span class="toc-number">3.2.</span> <span class="toc-text">%~fI 将 %I 扩展到一个完全合格的路径名</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#dI-仅将-I-扩展到一个驱动器号"><span class="toc-number">3.3.</span> <span class="toc-text">%~dI 仅将 %I 扩展到一个驱动器号</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#pI-仅将-I-扩展到一个路径"><span class="toc-number">3.4.</span> <span class="toc-text">%~pI 仅将 %I 扩展到一个路径</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#nI-仅将-I-扩展到一个文件名"><span class="toc-number">3.5.</span> <span class="toc-text">%~nI 仅将 %I 扩展到一个文件名</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#xI-仅将-I-扩展到一个文件扩展名"><span class="toc-number">3.6.</span> <span class="toc-text">%~xI 仅将 %I 扩展到一个文件扩展名</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#sI-扩展的路径只含有短名"><span class="toc-number">3.7.</span> <span class="toc-text">%~sI 扩展的路径只含有短名</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#aI-将-I-扩展到文件的文件属性"><span class="toc-number">3.8.</span> <span class="toc-text">%~aI 将 %I 扩展到文件的文件属性</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#tI-将-I-扩展到文件的日期-时间"><span class="toc-number">3.9.</span> <span class="toc-text">%~tI 将 %I 扩展到文件的日期/时间</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#zI-将-I-扩展到文件的大小"><span class="toc-number">3.10.</span> <span class="toc-text">%~zI 将 %I 扩展到文件的大小</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#PATH-I"><span class="toc-number">3.11.</span> <span class="toc-text">%~$PATH:I</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第四章-批处理中的变量"><span class="toc-number">4.</span> <span class="toc-text">第四章 批处理中的变量</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#一-系统变量"><span class="toc-number">4.1.</span> <span class="toc-text">一. 系统变量</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#二-自定义变量"><span class="toc-number">4.2.</span> <span class="toc-text">二. 自定义变量</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第五章-set命令详解"><span class="toc-number">5.</span> <span class="toc-text">第五章 set命令详解</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#一-用set命令设置自定义变量"><span class="toc-number">5.1.</span> <span class="toc-text">一. 用set命令设置自定义变量</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#二-用set命令进行简单计算"><span class="toc-number">5.2.</span> <span class="toc-text">二. 用set命令进行简单计算</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#三-用set命令进行字符串处理"><span class="toc-number">5.3.</span> <span class="toc-text">三. 用set命令进行字符串处理</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-字符串替换"><span class="toc-number">5.3.1.</span> <span class="toc-text">1. 字符串替换</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-字符串截取"><span class="toc-number">5.3.2.</span> <span class="toc-text">2. 字符串截取</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第六章-if命令讲解"><span class="toc-number">6.</span> <span class="toc-text">第六章 if命令讲解</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#第一种用法：IF-NOT-ERRORLEVEL-number-command"><span class="toc-number">6.1.</span> <span class="toc-text">第一种用法：IF [NOT] ERRORLEVEL number command</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#第二种用法：IF-NOT-string1-string2-command"><span class="toc-number">6.2.</span> <span class="toc-text">第二种用法：IF [NOT] string1==string2 command</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#第三种用法：IF-NOT-EXIST-filename-command"><span class="toc-number">6.3.</span> <span class="toc-text">第三种用法：IF [NOT] EXIST filename command</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#第四种用法：IF增强的用法"><span class="toc-number">6.4.</span> <span class="toc-text">第四种用法：IF增强的用法</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第七章-DOS编程高级技巧"><span class="toc-number">7.</span> <span class="toc-text">第七章 DOS编程高级技巧</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#一-交互界面设计"><span class="toc-number">7.1.</span> <span class="toc-text">一. 交互界面设计</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#二-if…else…条件语句"><span class="toc-number">7.2.</span> <span class="toc-text">二. if…else…条件语句</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#三-循环语句"><span class="toc-number">7.3.</span> <span class="toc-text">三. 循环语句</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#四-子程序"><span class="toc-number">7.4.</span> <span class="toc-text">四. 子程序</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#五-用ftp命令实现自动下载"><span class="toc-number">7.5.</span> <span class="toc-text">五. 用ftp命令实现自动下载</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#六-用7-ZIP实现命令行压缩和解压功能"><span class="toc-number">7.6.</span> <span class="toc-text">六. 用7-ZIP实现命令行压缩和解压功能</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#八-将批处理转化为可执行文件："><span class="toc-number">7.7.</span> <span class="toc-text">八. 将批处理转化为可执行文件：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#九-时间延迟"><span class="toc-number">7.8.</span> <span class="toc-text">九. 时间延迟</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-利用ping命令延时"><span class="toc-number">7.8.1.</span> <span class="toc-text">1. 利用ping命令延时</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-利用for命令延时"><span class="toc-number">7.8.2.</span> <span class="toc-text">2. 利用for命令延时</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-利用vbs延迟函数，精确度毫秒，误差1000毫秒内"><span class="toc-number">7.8.3.</span> <span class="toc-text">3. 利用vbs延迟函数，精确度毫秒，误差1000毫秒内</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#4-仅用批处理命令实现任意时间延迟，精确度10毫秒，误差50毫秒内"><span class="toc-number">7.8.4.</span> <span class="toc-text">4. 仅用批处理命令实现任意时间延迟，精确度10毫秒，误差50毫秒内</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#十-模拟进度条"><span class="toc-number">7.9.</span> <span class="toc-text">十. 模拟进度条</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#十一-特殊字符的输入及应用"><span class="toc-number">7.10.</span> <span class="toc-text">十一. 特殊字符的输入及应用</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#十二-随机数（-random-）的应用技巧"><span class="toc-number">7.11.</span> <span class="toc-text">十二. 随机数（%random%）的应用技巧</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#十三-变量嵌套-与-命令嵌套"><span class="toc-number">7.12.</span> <span class="toc-text">十三. 变量嵌套 与 命令嵌套</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#十四-文件内容筛选（type和findstr命令结合使用）"><span class="toc-number">7.13.</span> <span class="toc-text">十四. 文件内容筛选（type和findstr命令结合使用）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#前言"><span class="toc-number">8.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#目录"><span class="toc-number">9.</span> <span class="toc-text">目录</span></a></li></ol>
                    </div>
                </span>
            </div>
        </div>
        
    </div>
</aside>



  
  
  

  

  


          </div>
        </div>
      </div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
    	<div class="footer-left">
    		&copy; 2019 Code0
    	</div>
      	<div class="footer-right">
      		<a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
      	</div>
    </div>
  </div>
</footer>
    </div>
    <script>
	var yiliaConfig = {
		mathjax: false,
		isHome: false,
		isPost: true,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false,
		toc_hide_index: true,
		root: "/",
		innerArchive: true,
		showTags: false
	}
</script>

<script>!function(t){function n(e){if(r[e])return r[e].exports;var i=r[e]={exports:{},id:e,loaded:!1};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var r={};n.m=t,n.c=r,n.p="./",n(0)}([function(t,n,r){r(195),t.exports=r(191)},function(t,n,r){var e=r(3),i=r(52),o=r(27),u=r(28),c=r(53),f="prototype",a=function(t,n,r){var s,l,h,v,p=t&a.F,d=t&a.G,y=t&a.S,g=t&a.P,b=t&a.B,m=d?e:y?e[n]||(e[n]={}):(e[n]||{})[f],x=d?i:i[n]||(i[n]={}),w=x[f]||(x[f]={});d&&(r=n);for(s in r)l=!p&&m&&void 0!==m[s],h=(l?m:r)[s],v=b&&l?c(h,e):g&&"function"==typeof h?c(Function.call,h):h,m&&u(m,s,h,t&a.U),x[s]!=h&&o(x,s,v),g&&w[s]!=h&&(w[s]=h)};e.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,n,r){var e=r(6);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(126)("wks"),i=r(76),o=r(3).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){var e=r(94),i=r(33);t.exports=function(t){return e(i(t))}},function(t,n,r){t.exports=!r(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(2),i=r(167),o=r(50),u=Object.defineProperty;n.f=r(10)?Object.defineProperty:function(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){t.exports=!r(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(14),i=r(22);t.exports=r(12)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(20),i=r(58),o=r(42),u=Object.defineProperty;n.f=r(12)?Object.defineProperty:function(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){var e=r(40)("wks"),i=r(23),o=r(5).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var e=r(67),i=Math.min;t.exports=function(t){return t>0?i(e(t),9007199254740991):0}},function(t,n,r){var e=r(46);t.exports=function(t){return Object(e(t))}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,r){var e=r(63),i=r(34);t.exports=Object.keys||function(t){return e(t,i)}},function(t,n,r){var e=r(21);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,r){var e=r(11),i=r(66);t.exports=r(10)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(3),i=r(27),o=r(24),u=r(76)("src"),c="toString",f=Function[c],a=(""+f).split(c);r(52).inspectSource=function(t){return f.call(t)},(t.exports=function(t,n,r,c){var f="function"==typeof r;f&&(o(r,"name")||i(r,"name",n)),t[n]!==r&&(f&&(o(r,u)||i(r,u,t[n]?""+t[n]:a.join(String(n)))),t===e?t[n]=r:c?t[n]?t[n]=r:i(t,n,r):(delete t[n],i(t,n,r)))})(Function.prototype,c,function(){return"function"==typeof this&&this[u]||f.call(this)})},function(t,n,r){var e=r(1),i=r(4),o=r(46),u=function(t,n,r,e){var i=String(o(t)),u="<"+n;return""!==r&&(u+=" "+r+'="'+String(e).replace(/"/g,"&quot;")+'"'),u+">"+i+"</"+n+">"};t.exports=function(t,n){var r={};r[t]=n(u),e(e.P+e.F*i(function(){var n=""[t]('"');return n!==n.toLowerCase()||n.split('"').length>3}),"String",r)}},function(t,n,r){var e=r(115),i=r(46);t.exports=function(t){return e(i(t))}},function(t,n,r){var e=r(116),i=r(66),o=r(30),u=r(50),c=r(24),f=r(167),a=Object.getOwnPropertyDescriptor;n.f=r(10)?a:function(t,n){if(t=o(t),n=u(n,!0),f)try{return a(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},function(t,n,r){var e=r(24),i=r(17),o=r(145)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n){t.exports={}},function(t,n){t.exports=!0},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var e=r(14).f,i=r(8),o=r(15)("toStringTag");t.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},function(t,n,r){var e=r(40)("keys"),i=r(23);t.exports=function(t){return e[t]||(e[t]=i(t))}},function(t,n,r){var e=r(5),i="__core-js_shared__",o=e[i]||(e[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(21);t.exports=function(t,n){if(!e(t))return t;var r,i;if(n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!e(i=r.call(t)))return i;if(!n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(5),i=r(25),o=r(36),u=r(44),c=r(14).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,r){n.f=r(15)},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,n,r){var e=r(4);t.exports=function(t,n){return!!t&&e(function(){n?t.call(null,function(){},1):t.call(null)})}},function(t,n,r){var e=r(53),i=r(115),o=r(17),u=r(16),c=r(203);t.exports=function(t,n){var r=1==t,f=2==t,a=3==t,s=4==t,l=6==t,h=5==t||l,v=n||c;return function(n,c,p){for(var d,y,g=o(n),b=i(g),m=e(c,p,3),x=u(b.length),w=0,S=r?v(n,x):f?v(n,0):void 0;x>w;w++)if((h||w in b)&&(d=b[w],y=m(d,w,g),t))if(r)S[w]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return w;case 2:S.push(d)}else if(s)return!1;return l?-1:a||s?s:S}}},function(t,n,r){var e=r(1),i=r(52),o=r(4);t.exports=function(t,n){var r=(i.Object||{})[t]||Object[t],u={};u[t]=n(r),e(e.S+e.F*o(function(){r(1)}),"Object",u)}},function(t,n,r){var e=r(6);t.exports=function(t,n){if(!e(t))return t;var r,i;if(n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!e(i=r.call(t)))return i;if(!n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(5),i=r(25),o=r(91),u=r(13),c="prototype",f=function(t,n,r){var a,s,l,h=t&f.F,v=t&f.G,p=t&f.S,d=t&f.P,y=t&f.B,g=t&f.W,b=v?i:i[n]||(i[n]={}),m=b[c],x=v?e:p?e[n]:(e[n]||{})[c];v&&(r=n);for(a in r)(s=!h&&x&&void 0!==x[a])&&a in b||(l=s?x[a]:r[a],b[a]=v&&"function"!=typeof x[a]?r[a]:y&&s?o(l,e):g&&x[a]==l?function(t){var n=function(n,r,e){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,r)}return new t(n,r,e)}return t.apply(this,arguments)};return n[c]=t[c],n}(l):d&&"function"==typeof l?o(Function.call,l):l,d&&((b.virtual||(b.virtual={}))[a]=l,t&f.R&&m&&!m[a]&&u(m,a,l)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,n){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,n,r){var e=r(26);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},function(t,n,r){var e=r(183),i=r(1),o=r(126)("metadata"),u=o.store||(o.store=new(r(186))),c=function(t,n,r){var i=u.get(t);if(!i){if(!r)return;u.set(t,i=new e)}var o=i.get(n);if(!o){if(!r)return;i.set(n,o=new e)}return o},f=function(t,n,r){var e=c(n,r,!1);return void 0!==e&&e.has(t)},a=function(t,n,r){var e=c(n,r,!1);return void 0===e?void 0:e.get(t)},s=function(t,n,r,e){c(r,e,!0).set(t,n)},l=function(t,n){var r=c(t,n,!1),e=[];return r&&r.forEach(function(t,n){e.push(n)}),e},h=function(t){return void 0===t||"symbol"==typeof t?t:String(t)},v=function(t){i(i.S,"Reflect",t)};t.exports={store:u,map:c,has:f,get:a,set:s,keys:l,key:h,exp:v}},function(t,n,r){"use strict";if(r(10)){var e=r(69),i=r(3),o=r(4),u=r(1),c=r(127),f=r(152),a=r(53),s=r(68),l=r(66),h=r(27),v=r(73),p=r(67),d=r(16),y=r(75),g=r(50),b=r(24),m=r(180),x=r(114),w=r(6),S=r(17),_=r(137),O=r(70),E=r(32),P=r(71).f,j=r(154),F=r(76),M=r(7),A=r(48),N=r(117),T=r(146),I=r(155),k=r(80),L=r(123),R=r(74),C=r(130),D=r(160),U=r(11),W=r(31),G=U.f,B=W.f,V=i.RangeError,z=i.TypeError,q=i.Uint8Array,K="ArrayBuffer",J="Shared"+K,Y="BYTES_PER_ELEMENT",H="prototype",$=Array[H],X=f.ArrayBuffer,Q=f.DataView,Z=A(0),tt=A(2),nt=A(3),rt=A(4),et=A(5),it=A(6),ot=N(!0),ut=N(!1),ct=I.values,ft=I.keys,at=I.entries,st=$.lastIndexOf,lt=$.reduce,ht=$.reduceRight,vt=$.join,pt=$.sort,dt=$.slice,yt=$.toString,gt=$.toLocaleString,bt=M("iterator"),mt=M("toStringTag"),xt=F("typed_constructor"),wt=F("def_constructor"),St=c.CONSTR,_t=c.TYPED,Ot=c.VIEW,Et="Wrong length!",Pt=A(1,function(t,n){return Tt(T(t,t[wt]),n)}),jt=o(function(){return 1===new q(new Uint16Array([1]).buffer)[0]}),Ft=!!q&&!!q[H].set&&o(function(){new q(1).set({})}),Mt=function(t,n){if(void 0===t)throw z(Et);var r=+t,e=d(t);if(n&&!m(r,e))throw V(Et);return e},At=function(t,n){var r=p(t);if(r<0||r%n)throw V("Wrong offset!");return r},Nt=function(t){if(w(t)&&_t in t)return t;throw z(t+" is not a typed array!")},Tt=function(t,n){if(!(w(t)&&xt in t))throw z("It is not a typed array constructor!");return new t(n)},It=function(t,n){return kt(T(t,t[wt]),n)},kt=function(t,n){for(var r=0,e=n.length,i=Tt(t,e);e>r;)i[r]=n[r++];return i},Lt=function(t,n,r){G(t,n,{get:function(){return this._d[r]}})},Rt=function(t){var n,r,e,i,o,u,c=S(t),f=arguments.length,s=f>1?arguments[1]:void 0,l=void 0!==s,h=j(c);if(void 0!=h&&!_(h)){for(u=h.call(c),e=[],n=0;!(o=u.next()).done;n++)e.push(o.value);c=e}for(l&&f>2&&(s=a(s,arguments[2],2)),n=0,r=d(c.length),i=Tt(this,r);r>n;n++)i[n]=l?s(c[n],n):c[n];return i},Ct=function(){for(var t=0,n=arguments.length,r=Tt(this,n);n>t;)r[t]=arguments[t++];return r},Dt=!!q&&o(function(){gt.call(new q(1))}),Ut=function(){return gt.apply(Dt?dt.call(Nt(this)):Nt(this),arguments)},Wt={copyWithin:function(t,n){return D.call(Nt(this),t,n,arguments.length>2?arguments[2]:void 0)},every:function(t){return rt(Nt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return C.apply(Nt(this),arguments)},filter:function(t){return It(this,tt(Nt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return et(Nt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return it(Nt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){Z(Nt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return ut(Nt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return ot(Nt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return vt.apply(Nt(this),arguments)},lastIndexOf:function(t){return st.apply(Nt(this),arguments)},map:function(t){return Pt(Nt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return lt.apply(Nt(this),arguments)},reduceRight:function(t){return ht.apply(Nt(this),arguments)},reverse:function(){for(var t,n=this,r=Nt(n).length,e=Math.floor(r/2),i=0;i<e;)t=n[i],n[i++]=n[--r],n[r]=t;return n},some:function(t){return nt(Nt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return pt.call(Nt(this),t)},subarray:function(t,n){var r=Nt(this),e=r.length,i=y(t,e);return new(T(r,r[wt]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,d((void 0===n?e:y(n,e))-i))}},Gt=function(t,n){return It(this,dt.call(Nt(this),t,n))},Bt=function(t){Nt(this);var n=At(arguments[1],1),r=this.length,e=S(t),i=d(e.length),o=0;if(i+n>r)throw V(Et);for(;o<i;)this[n+o]=e[o++]},Vt={entries:function(){return at.call(Nt(this))},keys:function(){return ft.call(Nt(this))},values:function(){return ct.call(Nt(this))}},zt=function(t,n){return w(t)&&t[_t]&&"symbol"!=typeof n&&n in t&&String(+n)==String(n)},qt=function(t,n){return zt(t,n=g(n,!0))?l(2,t[n]):B(t,n)},Kt=function(t,n,r){return!(zt(t,n=g(n,!0))&&w(r)&&b(r,"value"))||b(r,"get")||b(r,"set")||r.configurable||b(r,"writable")&&!r.writable||b(r,"enumerable")&&!r.enumerable?G(t,n,r):(t[n]=r.value,t)};St||(W.f=qt,U.f=Kt),u(u.S+u.F*!St,"Object",{getOwnPropertyDescriptor:qt,defineProperty:Kt}),o(function(){yt.call({})})&&(yt=gt=function(){return vt.call(this)});var Jt=v({},Wt);v(Jt,Vt),h(Jt,bt,Vt.values),v(Jt,{slice:Gt,set:Bt,constructor:function(){},toString:yt,toLocaleString:Ut}),Lt(Jt,"buffer","b"),Lt(Jt,"byteOffset","o"),Lt(Jt,"byteLength","l"),Lt(Jt,"length","e"),G(Jt,mt,{get:function(){return this[_t]}}),t.exports=function(t,n,r,f){f=!!f;var a=t+(f?"Clamped":"")+"Array",l="Uint8Array"!=a,v="get"+t,p="set"+t,y=i[a],g=y||{},b=y&&E(y),m=!y||!c.ABV,S={},_=y&&y[H],j=function(t,r){var e=t._d;return e.v[v](r*n+e.o,jt)},F=function(t,r,e){var i=t._d;f&&(e=(e=Math.round(e))<0?0:e>255?255:255&e),i.v[p](r*n+i.o,e,jt)},M=function(t,n){G(t,n,{get:function(){return j(this,n)},set:function(t){return F(this,n,t)},enumerable:!0})};m?(y=r(function(t,r,e,i){s(t,y,a,"_d");var o,u,c,f,l=0,v=0;if(w(r)){if(!(r instanceof X||(f=x(r))==K||f==J))return _t in r?kt(y,r):Rt.call(y,r);o=r,v=At(e,n);var p=r.byteLength;if(void 0===i){if(p%n)throw V(Et);if((u=p-v)<0)throw V(Et)}else if((u=d(i)*n)+v>p)throw V(Et);c=u/n}else c=Mt(r,!0),u=c*n,o=new X(u);for(h(t,"_d",{b:o,o:v,l:u,e:c,v:new Q(o)});l<c;)M(t,l++)}),_=y[H]=O(Jt),h(_,"constructor",y)):L(function(t){new y(null),new y(t)},!0)||(y=r(function(t,r,e,i){s(t,y,a);var o;return w(r)?r instanceof X||(o=x(r))==K||o==J?void 0!==i?new g(r,At(e,n),i):void 0!==e?new g(r,At(e,n)):new g(r):_t in r?kt(y,r):Rt.call(y,r):new g(Mt(r,l))}),Z(b!==Function.prototype?P(g).concat(P(b)):P(g),function(t){t in y||h(y,t,g[t])}),y[H]=_,e||(_.constructor=y));var A=_[bt],N=!!A&&("values"==A.name||void 0==A.name),T=Vt.values;h(y,xt,!0),h(_,_t,a),h(_,Ot,!0),h(_,wt,y),(f?new y(1)[mt]==a:mt in _)||G(_,mt,{get:function(){return a}}),S[a]=y,u(u.G+u.W+u.F*(y!=g),S),u(u.S,a,{BYTES_PER_ELEMENT:n,from:Rt,of:Ct}),Y in _||h(_,Y,n),u(u.P,a,Wt),R(a),u(u.P+u.F*Ft,a,{set:Bt}),u(u.P+u.F*!N,a,Vt),u(u.P+u.F*(_.toString!=yt),a,{toString:yt}),u(u.P+u.F*o(function(){new y(1).slice()}),a,{slice:Gt}),u(u.P+u.F*(o(function(){return[1,2].toLocaleString()!=new y([1,2]).toLocaleString()})||!o(function(){_.toLocaleString.call([1,2])})),a,{toLocaleString:Ut}),k[a]=N?A:T,e||N||h(_,bt,T)}}else t.exports=function(){}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(21),i=r(5).document,o=e(i)&&e(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n,r){t.exports=!r(12)&&!r(18)(function(){return 7!=Object.defineProperty(r(57)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){"use strict";var e=r(36),i=r(51),o=r(64),u=r(13),c=r(8),f=r(35),a=r(96),s=r(38),l=r(103),h=r(15)("iterator"),v=!([].keys&&"next"in[].keys()),p="keys",d="values",y=function(){return this};t.exports=function(t,n,r,g,b,m,x){a(r,n,g);var w,S,_,O=function(t){if(!v&&t in F)return F[t];switch(t){case p:case d:return function(){return new r(this,t)}}return function(){return new r(this,t)}},E=n+" Iterator",P=b==d,j=!1,F=t.prototype,M=F[h]||F["@@iterator"]||b&&F[b],A=M||O(b),N=b?P?O("entries"):A:void 0,T="Array"==n?F.entries||M:M;if(T&&(_=l(T.call(new t)))!==Object.prototype&&(s(_,E,!0),e||c(_,h)||u(_,h,y)),P&&M&&M.name!==d&&(j=!0,A=function(){return M.call(this)}),e&&!x||!v&&!j&&F[h]||u(F,h,A),f[n]=A,f[E]=y,b)if(w={values:P?A:O(d),keys:m?A:O(p),entries:N},x)for(S in w)S in F||o(F,S,w[S]);else i(i.P+i.F*(v||j),n,w);return w}},function(t,n,r){var e=r(20),i=r(100),o=r(34),u=r(39)("IE_PROTO"),c=function(){},f="prototype",a=function(){var t,n=r(57)("iframe"),e=o.length;for(n.style.display="none",r(93).appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;e--;)delete a[f][o[e]];return a()};t.exports=Object.create||function(t,n){var r;return null!==t?(c[f]=e(t),r=new c,c[f]=null,r[u]=t):r=a(),void 0===n?r:i(r,n)}},function(t,n,r){var e=r(63),i=r(34).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,i)}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){var e=r(8),i=r(9),o=r(90)(!1),u=r(39)("IE_PROTO");t.exports=function(t,n){var r,c=i(t),f=0,a=[];for(r in c)r!=u&&e(c,r)&&a.push(r);for(;n.length>f;)e(c,r=n[f++])&&(~o(a,r)||a.push(r));return a}},function(t,n,r){t.exports=r(13)},function(t,n,r){var e=r(76)("meta"),i=r(6),o=r(24),u=r(11).f,c=0,f=Object.isExtensible||function(){return!0},a=!r(4)(function(){return f(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!f(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!f(t))return!0;if(!n)return!1;s(t)}return t[e].w},v=function(t){return a&&p.NEED&&f(t)&&!o(t,e)&&s(t),t},p=t.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:v}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||void 0!==e&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n){t.exports=!1},function(t,n,r){var e=r(2),i=r(173),o=r(133),u=r(145)("IE_PROTO"),c=function(){},f="prototype",a=function(){var t,n=r(132)("iframe"),e=o.length;for(n.style.display="none",r(135).appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;e--;)delete a[f][o[e]];return a()};t.exports=Object.create||function(t,n){var r;return null!==t?(c[f]=e(t),r=new c,c[f]=null,r[u]=t):r=a(),void 0===n?r:i(r,n)}},function(t,n,r){var e=r(175),i=r(133).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,i)}},function(t,n,r){var e=r(175),i=r(133);t.exports=Object.keys||function(t){return e(t,i)}},function(t,n,r){var e=r(28);t.exports=function(t,n,r){for(var i in n)e(t,i,n[i],r);return t}},function(t,n,r){"use strict";var e=r(3),i=r(11),o=r(10),u=r(7)("species");t.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n,r){var e=r(67),i=Math.max,o=Math.min;t.exports=function(t,n){return t=e(t),t<0?i(t+n,0):o(t,n)}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(33);t.exports=function(t){return Object(e(t))}},function(t,n,r){var e=r(7)("unscopables"),i=Array.prototype;void 0==i[e]&&r(27)(i,e,{}),t.exports=function(t){i[e][t]=!0}},function(t,n,r){var e=r(53),i=r(169),o=r(137),u=r(2),c=r(16),f=r(154),a={},s={},n=t.exports=function(t,n,r,l,h){var v,p,d,y,g=h?function(){return t}:f(t),b=e(r,l,n?2:1),m=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(v=c(t.length);v>m;m++)if((y=n?b(u(p=t[m])[0],p[1]):b(t[m]))===a||y===s)return y}else for(d=g.call(t);!(p=d.next()).done;)if((y=i(d,b,p.value,n))===a||y===s)return y};n.BREAK=a,n.RETURN=s},function(t,n){t.exports={}},function(t,n,r){var e=r(11).f,i=r(24),o=r(7)("toStringTag");t.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},function(t,n,r){var e=r(1),i=r(46),o=r(4),u=r(150),c="["+u+"]",f="​",a=RegExp("^"+c+c+"*"),s=RegExp(c+c+"*$"),l=function(t,n,r){var i={},c=o(function(){return!!u[t]()||f[t]()!=f}),a=i[t]=c?n(h):u[t];r&&(i[r]=a),e(e.P+e.F*c,"String",i)},h=l.trim=function(t,n){return t=String(i(t)),1&n&&(t=t.replace(a,"")),2&n&&(t=t.replace(s,"")),t};t.exports=l},function(t,n,r){t.exports={default:r(86),__esModule:!0}},function(t,n,r){t.exports={default:r(87),__esModule:!0}},function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var i=r(84),o=e(i),u=r(83),c=e(u),f="function"==typeof c.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof c.default&&t.constructor===c.default&&t!==c.default.prototype?"symbol":typeof t};n.default="function"==typeof c.default&&"symbol"===f(o.default)?function(t){return void 0===t?"undefined":f(t)}:function(t){return t&&"function"==typeof c.default&&t.constructor===c.default&&t!==c.default.prototype?"symbol":void 0===t?"undefined":f(t)}},function(t,n,r){r(110),r(108),r(111),r(112),t.exports=r(25).Symbol},function(t,n,r){r(109),r(113),t.exports=r(44).f("iterator")},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){t.exports=function(){}},function(t,n,r){var e=r(9),i=r(106),o=r(105);t.exports=function(t){return function(n,r,u){var c,f=e(n),a=i(f.length),s=o(u,a);if(t&&r!=r){for(;a>s;)if((c=f[s++])!=c)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===r)return t||s||0;return!t&&-1}}},function(t,n,r){var e=r(88);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},function(t,n,r){var e=r(19),i=r(62),o=r(37);t.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),f=o.f,a=0;c.length>a;)f.call(t,u=c[a++])&&n.push(u);return n}},function(t,n,r){t.exports=r(5).document&&document.documentElement},function(t,n,r){var e=r(56);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n,r){var e=r(56);t.exports=Array.isArray||function(t){return"Array"==e(t)}},function(t,n,r){"use strict";var e=r(60),i=r(22),o=r(38),u={};r(13)(u,r(15)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,r){var e=r(19),i=r(9);t.exports=function(t,n){for(var r,o=i(t),u=e(o),c=u.length,f=0;c>f;)if(o[r=u[f++]]===n)return r}},function(t,n,r){var e=r(23)("meta"),i=r(21),o=r(8),u=r(14).f,c=0,f=Object.isExtensible||function(){return!0},a=!r(18)(function(){return f(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!f(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!f(t))return!0;if(!n)return!1;s(t)}return t[e].w},v=function(t){return a&&p.NEED&&f(t)&&!o(t,e)&&s(t),t},p=t.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:v}},function(t,n,r){var e=r(14),i=r(20),o=r(19);t.exports=r(12)?Object.defineProperties:function(t,n){i(t);for(var r,u=o(n),c=u.length,f=0;c>f;)e.f(t,r=u[f++],n[r]);return t}},function(t,n,r){var e=r(37),i=r(22),o=r(9),u=r(42),c=r(8),f=r(58),a=Object.getOwnPropertyDescriptor;n.f=r(12)?a:function(t,n){if(t=o(t),n=u(n,!0),f)try{return a(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},function(t,n,r){var e=r(9),i=r(61).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return i(t)}catch(t){return u.slice()}};t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?c(t):i(e(t))}},function(t,n,r){var e=r(8),i=r(77),o=r(39)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,r){var e=r(41),i=r(33);t.exports=function(t){return function(n,r){var o,u,c=String(i(n)),f=e(r),a=c.length;return f<0||f>=a?t?"":void 0:(o=c.charCodeAt(f),o<55296||o>56319||f+1===a||(u=c.charCodeAt(f+1))<56320||u>57343?t?c.charAt(f):o:t?c.slice(f,f+2):u-56320+(o-55296<<10)+65536)}}},function(t,n,r){var e=r(41),i=Math.max,o=Math.min;t.exports=function(t,n){return t=e(t),t<0?i(t+n,0):o(t,n)}},function(t,n,r){var e=r(41),i=Math.min;t.exports=function(t){return t>0?i(e(t),9007199254740991):0}},function(t,n,r){"use strict";var e=r(89),i=r(97),o=r(35),u=r(9);t.exports=r(59)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):"keys"==n?i(0,r):"values"==n?i(0,t[r]):i(0,[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},function(t,n){},function(t,n,r){"use strict";var e=r(104)(!0);r(59)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},function(t,n,r){"use strict";var e=r(5),i=r(8),o=r(12),u=r(51),c=r(64),f=r(99).KEY,a=r(18),s=r(40),l=r(38),h=r(23),v=r(15),p=r(44),d=r(43),y=r(98),g=r(92),b=r(95),m=r(20),x=r(9),w=r(42),S=r(22),_=r(60),O=r(102),E=r(101),P=r(14),j=r(19),F=E.f,M=P.f,A=O.f,N=e.Symbol,T=e.JSON,I=T&&T.stringify,k="prototype",L=v("_hidden"),R=v("toPrimitive"),C={}.propertyIsEnumerable,D=s("symbol-registry"),U=s("symbols"),W=s("op-symbols"),G=Object[k],B="function"==typeof N,V=e.QObject,z=!V||!V[k]||!V[k].findChild,q=o&&a(function(){return 7!=_(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=F(G,n);e&&delete G[n],M(t,n,r),e&&t!==G&&M(G,n,e)}:M,K=function(t){var n=U[t]=_(N[k]);return n._k=t,n},J=B&&"symbol"==typeof N.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof N},Y=function(t,n,r){return t===G&&Y(W,n,r),m(t),n=w(n,!0),m(r),i(U,n)?(r.enumerable?(i(t,L)&&t[L][n]&&(t[L][n]=!1),r=_(r,{enumerable:S(0,!1)})):(i(t,L)||M(t,L,S(1,{})),t[L][n]=!0),q(t,n,r)):M(t,n,r)},H=function(t,n){m(t);for(var r,e=g(n=x(n)),i=0,o=e.length;o>i;)Y(t,r=e[i++],n[r]);return t},$=function(t,n){return void 0===n?_(t):H(_(t),n)},X=function(t){var n=C.call(this,t=w(t,!0));return!(this===G&&i(U,t)&&!i(W,t))&&(!(n||!i(this,t)||!i(U,t)||i(this,L)&&this[L][t])||n)},Q=function(t,n){if(t=x(t),n=w(n,!0),t!==G||!i(U,n)||i(W,n)){var r=F(t,n);return!r||!i(U,n)||i(t,L)&&t[L][n]||(r.enumerable=!0),r}},Z=function(t){for(var n,r=A(x(t)),e=[],o=0;r.length>o;)i(U,n=r[o++])||n==L||n==f||e.push(n);return e},tt=function(t){for(var n,r=t===G,e=A(r?W:x(t)),o=[],u=0;e.length>u;)!i(U,n=e[u++])||r&&!i(G,n)||o.push(U[n]);return o};B||(N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),n=function(r){this===G&&n.call(W,r),i(this,L)&&i(this[L],t)&&(this[L][t]=!1),q(this,t,S(1,r))};return o&&z&&q(G,t,{configurable:!0,set:n}),K(t)},c(N[k],"toString",function(){return this._k}),E.f=Q,P.f=Y,r(61).f=O.f=Z,r(37).f=X,r(62).f=tt,o&&!r(36)&&c(G,"propertyIsEnumerable",X,!0),p.f=function(t){return K(v(t))}),u(u.G+u.W+u.F*!B,{Symbol:N});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)v(nt[rt++]);for(var nt=j(v.store),rt=0;nt.length>rt;)d(nt[rt++]);u(u.S+u.F*!B,"Symbol",{for:function(t){return i(D,t+="")?D[t]:D[t]=N(t)},keyFor:function(t){if(J(t))return y(D,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){z=!0},useSimple:function(){z=!1}}),u(u.S+u.F*!B,"Object",{create:$,defineProperty:Y,defineProperties:H,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:tt}),T&&u(u.S+u.F*(!B||a(function(){var t=N();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!J(t)){for(var n,r,e=[t],i=1;arguments.length>i;)e.push(arguments[i++]);return n=e[1],"function"==typeof n&&(r=n),!r&&b(n)||(n=function(t,n){if(r&&(n=r.call(this,t,n)),!J(n))return n}),e[1]=n,I.apply(T,e)}}}),N[k][R]||r(13)(N[k],R,N[k].valueOf),l(N,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},function(t,n,r){r(43)("asyncIterator")},function(t,n,r){r(43)("observable")},function(t,n,r){r(107);for(var e=r(5),i=r(13),o=r(35),u=r(15)("toStringTag"),c=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],f=0;f<5;f++){var a=c[f],s=e[a],l=s&&s.prototype;l&&!l[u]&&i(l,u,a),o[a]=o.Array}},function(t,n,r){var e=r(45),i=r(7)("toStringTag"),o="Arguments"==e(function(){return arguments}()),u=function(t,n){try{return t[n]}catch(t){}};t.exports=function(t){var n,r,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=u(n=Object(t),i))?r:o?e(n):"Object"==(c=e(n))&&"function"==typeof n.callee?"Arguments":c}},function(t,n,r){var e=r(45);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var e=r(30),i=r(16),o=r(75);t.exports=function(t){return function(n,r,u){var c,f=e(n),a=i(f.length),s=o(u,a);if(t&&r!=r){for(;a>s;)if((c=f[s++])!=c)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===r)return t||s||0;return!t&&-1}}},function(t,n,r){"use strict";var e=r(3),i=r(1),o=r(28),u=r(73),c=r(65),f=r(79),a=r(68),s=r(6),l=r(4),h=r(123),v=r(81),p=r(136);t.exports=function(t,n,r,d,y,g){var b=e[t],m=b,x=y?"set":"add",w=m&&m.prototype,S={},_=function(t){var n=w[t];o(w,t,"delete"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"has"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function(t){return n.call(this,0===t?0:t),this}:function(t,r){return n.call(this,0===t?0:t,r),this})};if("function"==typeof m&&(g||w.forEach&&!l(function(){(new m).entries().next()}))){var O=new m,E=O[x](g?{}:-0,1)!=O,P=l(function(){O.has(1)}),j=h(function(t){new m(t)}),F=!g&&l(function(){for(var t=new m,n=5;n--;)t[x](n,n);return!t.has(-0)});j||(m=n(function(n,r){a(n,m,t);var e=p(new b,n,m);return void 0!=r&&f(r,y,e[x],e),e}),m.prototype=w,w.constructor=m),(P||F)&&(_("delete"),_("has"),y&&_("get")),(F||E)&&_(x),g&&w.clear&&delete w.clear}else m=d.getConstructor(n,t,y,x),u(m.prototype,r),c.NEED=!0;return v(m,t),S[t]=m,i(i.G+i.W+i.F*(m!=b),S),g||d.setStrong(m,t,y),m}},function(t,n,r){"use strict";var e=r(27),i=r(28),o=r(4),u=r(46),c=r(7);t.exports=function(t,n,r){var f=c(t),a=r(u,f,""[t]),s=a[0],l=a[1];o(function(){var n={};return n[f]=function(){return 7},7!=""[t](n)})&&(i(String.prototype,t,s),e(RegExp.prototype,f,2==n?function(t,n){return l.call(t,this,n)}:function(t){return l.call(t,this)}))}
},function(t,n,r){"use strict";var e=r(2);t.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},function(t,n){t.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},function(t,n,r){var e=r(6),i=r(45),o=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},function(t,n,r){var e=r(7)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var o=[7],u=o[e]();u.next=function(){return{done:r=!0}},o[e]=function(){return u},t(o)}catch(t){}return r}},function(t,n,r){t.exports=r(69)||!r(4)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete r(3)[t]})},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){var e=r(3),i="__core-js_shared__",o=e[i]||(e[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,n,r){for(var e,i=r(3),o=r(27),u=r(76),c=u("typed_array"),f=u("view"),a=!(!i.ArrayBuffer||!i.DataView),s=a,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(e=i[h[l++]])?(o(e.prototype,c,!0),o(e.prototype,f,!0)):s=!1;t.exports={ABV:a,CONSTR:s,TYPED:c,VIEW:f}},function(t,n){"use strict";var r={versions:function(){var t=window.navigator.userAgent;return{trident:t.indexOf("Trident")>-1,presto:t.indexOf("Presto")>-1,webKit:t.indexOf("AppleWebKit")>-1,gecko:t.indexOf("Gecko")>-1&&-1==t.indexOf("KHTML"),mobile:!!t.match(/AppleWebKit.*Mobile.*/),ios:!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:t.indexOf("Android")>-1||t.indexOf("Linux")>-1,iPhone:t.indexOf("iPhone")>-1||t.indexOf("Mac")>-1,iPad:t.indexOf("iPad")>-1,webApp:-1==t.indexOf("Safari"),weixin:-1==t.indexOf("MicroMessenger")}}()};t.exports=r},function(t,n,r){"use strict";var e=r(85),i=function(t){return t&&t.__esModule?t:{default:t}}(e),o=function(){function t(t,n,e){return n||e?String.fromCharCode(n||e):r[t]||t}function n(t){return e[t]}var r={"&quot;":'"',"&lt;":"<","&gt;":">","&amp;":"&","&nbsp;":" "},e={};for(var u in r)e[r[u]]=u;return r["&apos;"]="'",e["'"]="&#39;",{encode:function(t){return t?(""+t).replace(/['<> "&]/g,n).replace(/\r?\n/g,"<br/>").replace(/\s/g,"&nbsp;"):""},decode:function(n){return n?(""+n).replace(/<br\s*\/?>/gi,"\n").replace(/&quot;|&lt;|&gt;|&amp;|&nbsp;|&apos;|&#(\d+);|&#(\d+)/g,t).replace(/\u00a0/g," "):""},encodeBase16:function(t){if(!t)return t;t+="";for(var n=[],r=0,e=t.length;e>r;r++)n.push(t.charCodeAt(r).toString(16).toUpperCase());return n.join("")},encodeBase16forJSON:function(t){if(!t)return t;t=t.replace(/[\u4E00-\u9FBF]/gi,function(t){return escape(t).replace("%u","\\u")});for(var n=[],r=0,e=t.length;e>r;r++)n.push(t.charCodeAt(r).toString(16).toUpperCase());return n.join("")},decodeBase16:function(t){if(!t)return t;t+="";for(var n=[],r=0,e=t.length;e>r;r+=2)n.push(String.fromCharCode("0x"+t.slice(r,r+2)));return n.join("")},encodeObject:function(t){if(t instanceof Array)for(var n=0,r=t.length;r>n;n++)t[n]=o.encodeObject(t[n]);else if("object"==(void 0===t?"undefined":(0,i.default)(t)))for(var e in t)t[e]=o.encodeObject(t[e]);else if("string"==typeof t)return o.encode(t);return t},loadScript:function(t){var n=document.createElement("script");document.getElementsByTagName("body")[0].appendChild(n),n.setAttribute("src",t)},addLoadEvent:function(t){var n=window.onload;"function"!=typeof window.onload?window.onload=t:window.onload=function(){n(),t()}}}}();t.exports=o},function(t,n,r){"use strict";var e=r(17),i=r(75),o=r(16);t.exports=function(t){for(var n=e(this),r=o(n.length),u=arguments.length,c=i(u>1?arguments[1]:void 0,r),f=u>2?arguments[2]:void 0,a=void 0===f?r:i(f,r);a>c;)n[c++]=t;return n}},function(t,n,r){"use strict";var e=r(11),i=r(66);t.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},function(t,n,r){var e=r(6),i=r(3).document,o=e(i)&&e(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var e=r(7)("match");t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,!"/./"[t](n)}catch(t){}}return!0}},function(t,n,r){t.exports=r(3).document&&document.documentElement},function(t,n,r){var e=r(6),i=r(144).set;t.exports=function(t,n,r){var o,u=n.constructor;return u!==r&&"function"==typeof u&&(o=u.prototype)!==r.prototype&&e(o)&&i&&i(t,o),t}},function(t,n,r){var e=r(80),i=r(7)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},function(t,n,r){var e=r(45);t.exports=Array.isArray||function(t){return"Array"==e(t)}},function(t,n,r){"use strict";var e=r(70),i=r(66),o=r(81),u={};r(27)(u,r(7)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},function(t,n,r){"use strict";var e=r(69),i=r(1),o=r(28),u=r(27),c=r(24),f=r(80),a=r(139),s=r(81),l=r(32),h=r(7)("iterator"),v=!([].keys&&"next"in[].keys()),p="keys",d="values",y=function(){return this};t.exports=function(t,n,r,g,b,m,x){a(r,n,g);var w,S,_,O=function(t){if(!v&&t in F)return F[t];switch(t){case p:case d:return function(){return new r(this,t)}}return function(){return new r(this,t)}},E=n+" Iterator",P=b==d,j=!1,F=t.prototype,M=F[h]||F["@@iterator"]||b&&F[b],A=M||O(b),N=b?P?O("entries"):A:void 0,T="Array"==n?F.entries||M:M;if(T&&(_=l(T.call(new t)))!==Object.prototype&&(s(_,E,!0),e||c(_,h)||u(_,h,y)),P&&M&&M.name!==d&&(j=!0,A=function(){return M.call(this)}),e&&!x||!v&&!j&&F[h]||u(F,h,A),f[n]=A,f[E]=y,b)if(w={values:P?A:O(d),keys:m?A:O(p),entries:N},x)for(S in w)S in F||o(F,S,w[S]);else i(i.P+i.F*(v||j),n,w);return w}},function(t,n){var r=Math.expm1;t.exports=!r||r(10)>22025.465794806718||r(10)<22025.465794806718||-2e-17!=r(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:r},function(t,n){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n,r){var e=r(3),i=r(151).set,o=e.MutationObserver||e.WebKitMutationObserver,u=e.process,c=e.Promise,f="process"==r(45)(u);t.exports=function(){var t,n,r,a=function(){var e,i;for(f&&(e=u.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(f)r=function(){u.nextTick(a)};else if(o){var s=!0,l=document.createTextNode("");new o(a).observe(l,{characterData:!0}),r=function(){l.data=s=!s}}else if(c&&c.resolve){var h=c.resolve();r=function(){h.then(a)}}else r=function(){i.call(e,a)};return function(e){var i={fn:e,next:void 0};n&&(n.next=i),t||(t=i,r()),n=i}}},function(t,n,r){var e=r(6),i=r(2),o=function(t,n){if(i(t),!e(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,e){try{e=r(53)(Function.call,r(31).f(Object.prototype,"__proto__").set,2),e(t,[]),n=!(t instanceof Array)}catch(t){n=!0}return function(t,r){return o(t,r),n?t.__proto__=r:e(t,r),t}}({},!1):void 0),check:o}},function(t,n,r){var e=r(126)("keys"),i=r(76);t.exports=function(t){return e[t]||(e[t]=i(t))}},function(t,n,r){var e=r(2),i=r(26),o=r(7)("species");t.exports=function(t,n){var r,u=e(t).constructor;return void 0===u||void 0==(r=e(u)[o])?n:i(r)}},function(t,n,r){var e=r(67),i=r(46);t.exports=function(t){return function(n,r){var o,u,c=String(i(n)),f=e(r),a=c.length;return f<0||f>=a?t?"":void 0:(o=c.charCodeAt(f),o<55296||o>56319||f+1===a||(u=c.charCodeAt(f+1))<56320||u>57343?t?c.charAt(f):o:t?c.slice(f,f+2):u-56320+(o-55296<<10)+65536)}}},function(t,n,r){var e=r(122),i=r(46);t.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(t))}},function(t,n,r){"use strict";var e=r(67),i=r(46);t.exports=function(t){var n=String(i(this)),r="",o=e(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(n+=n))1&o&&(r+=n);return r}},function(t,n){t.exports="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff"},function(t,n,r){var e,i,o,u=r(53),c=r(121),f=r(135),a=r(132),s=r(3),l=s.process,h=s.setImmediate,v=s.clearImmediate,p=s.MessageChannel,d=0,y={},g="onreadystatechange",b=function(){var t=+this;if(y.hasOwnProperty(t)){var n=y[t];delete y[t],n()}},m=function(t){b.call(t.data)};h&&v||(h=function(t){for(var n=[],r=1;arguments.length>r;)n.push(arguments[r++]);return y[++d]=function(){c("function"==typeof t?t:Function(t),n)},e(d),d},v=function(t){delete y[t]},"process"==r(45)(l)?e=function(t){l.nextTick(u(b,t,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=m,e=u(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(e=function(t){s.postMessage(t+"","*")},s.addEventListener("message",m,!1)):e=g in a("script")?function(t){f.appendChild(a("script"))[g]=function(){f.removeChild(this),b.call(t)}}:function(t){setTimeout(u(b,t,1),0)}),t.exports={set:h,clear:v}},function(t,n,r){"use strict";var e=r(3),i=r(10),o=r(69),u=r(127),c=r(27),f=r(73),a=r(4),s=r(68),l=r(67),h=r(16),v=r(71).f,p=r(11).f,d=r(130),y=r(81),g="ArrayBuffer",b="DataView",m="prototype",x="Wrong length!",w="Wrong index!",S=e[g],_=e[b],O=e.Math,E=e.RangeError,P=e.Infinity,j=S,F=O.abs,M=O.pow,A=O.floor,N=O.log,T=O.LN2,I="buffer",k="byteLength",L="byteOffset",R=i?"_b":I,C=i?"_l":k,D=i?"_o":L,U=function(t,n,r){var e,i,o,u=Array(r),c=8*r-n-1,f=(1<<c)-1,a=f>>1,s=23===n?M(2,-24)-M(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for(t=F(t),t!=t||t===P?(i=t!=t?1:0,e=f):(e=A(N(t)/T),t*(o=M(2,-e))<1&&(e--,o*=2),t+=e+a>=1?s/o:s*M(2,1-a),t*o>=2&&(e++,o/=2),e+a>=f?(i=0,e=f):e+a>=1?(i=(t*o-1)*M(2,n),e+=a):(i=t*M(2,a-1)*M(2,n),e=0));n>=8;u[l++]=255&i,i/=256,n-=8);for(e=e<<n|i,c+=n;c>0;u[l++]=255&e,e/=256,c-=8);return u[--l]|=128*h,u},W=function(t,n,r){var e,i=8*r-n-1,o=(1<<i)-1,u=o>>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;c>0;s=256*s+t[f],f--,c-=8);for(e=s&(1<<-c)-1,s>>=-c,c+=n;c>0;e=256*e+t[f],f--,c-=8);if(0===s)s=1-u;else{if(s===o)return e?NaN:a?-P:P;e+=M(2,n),s-=u}return(a?-1:1)*e*M(2,s-n)},G=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},B=function(t){return[255&t]},V=function(t){return[255&t,t>>8&255]},z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},q=function(t){return U(t,52,8)},K=function(t){return U(t,23,4)},J=function(t,n,r){p(t[m],n,{get:function(){return this[r]}})},Y=function(t,n,r,e){var i=+r,o=l(i);if(i!=o||o<0||o+n>t[C])throw E(w);var u=t[R]._b,c=o+t[D],f=u.slice(c,c+n);return e?f:f.reverse()},H=function(t,n,r,e,i,o){var u=+r,c=l(u);if(u!=c||c<0||c+n>t[C])throw E(w);for(var f=t[R]._b,a=c+t[D],s=e(+i),h=0;h<n;h++)f[a+h]=s[o?h:n-h-1]},$=function(t,n){s(t,S,g);var r=+n,e=h(r);if(r!=e)throw E(x);return e};if(u.ABV){if(!a(function(){new S})||!a(function(){new S(.5)})){S=function(t){return new j($(this,t))};for(var X,Q=S[m]=j[m],Z=v(j),tt=0;Z.length>tt;)(X=Z[tt++])in S||c(S,X,j[X]);o||(Q.constructor=S)}var nt=new _(new S(2)),rt=_[m].setInt8;nt.setInt8(0,2147483648),nt.setInt8(1,2147483649),!nt.getInt8(0)&&nt.getInt8(1)||f(_[m],{setInt8:function(t,n){rt.call(this,t,n<<24>>24)},setUint8:function(t,n){rt.call(this,t,n<<24>>24)}},!0)}else S=function(t){var n=$(this,t);this._b=d.call(Array(n),0),this[C]=n},_=function(t,n,r){s(this,_,b),s(t,S,b);var e=t[C],i=l(n);if(i<0||i>e)throw E("Wrong offset!");if(r=void 0===r?e-i:h(r),i+r>e)throw E(x);this[R]=t,this[D]=i,this[C]=r},i&&(J(S,k,"_l"),J(_,I,"_b"),J(_,k,"_l"),J(_,L,"_o")),f(_[m],{getInt8:function(t){return Y(this,1,t)[0]<<24>>24},getUint8:function(t){return Y(this,1,t)[0]},getInt16:function(t){var n=Y(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function(t){var n=Y(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function(t){return G(Y(this,4,t,arguments[1]))},getUint32:function(t){return G(Y(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return W(Y(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return W(Y(this,8,t,arguments[1]),52,8)},setInt8:function(t,n){H(this,1,t,B,n)},setUint8:function(t,n){H(this,1,t,B,n)},setInt16:function(t,n){H(this,2,t,V,n,arguments[2])},setUint16:function(t,n){H(this,2,t,V,n,arguments[2])},setInt32:function(t,n){H(this,4,t,z,n,arguments[2])},setUint32:function(t,n){H(this,4,t,z,n,arguments[2])},setFloat32:function(t,n){H(this,4,t,K,n,arguments[2])},setFloat64:function(t,n){H(this,8,t,q,n,arguments[2])}});y(S,g),y(_,b),c(_[m],u.VIEW,!0),n[g]=S,n[b]=_},function(t,n,r){var e=r(3),i=r(52),o=r(69),u=r(182),c=r(11).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,r){var e=r(114),i=r(7)("iterator"),o=r(80);t.exports=r(52).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[e(t)]}},function(t,n,r){"use strict";var e=r(78),i=r(170),o=r(80),u=r(30);t.exports=r(140)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):"keys"==n?i(0,r):"values"==n?i(0,t[r]):i(0,[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},function(t,n){function r(t,n){t.classList?t.classList.add(n):t.className+=" "+n}t.exports=r},function(t,n){function r(t,n){if(t.classList)t.classList.remove(n);else{var r=new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi");t.className=t.className.replace(r," ")}}t.exports=r},function(t,n){function r(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function i(t){if(s===setTimeout)return setTimeout(t,0);if((s===r||!s)&&setTimeout)return s=setTimeout,setTimeout(t,0);try{return s(t,0)}catch(n){try{return s.call(null,t,0)}catch(n){return s.call(this,t,0)}}}function o(t){if(l===clearTimeout)return clearTimeout(t);if((l===e||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(n){try{return l.call(null,t)}catch(n){return l.call(this,t)}}}function u(){d&&v&&(d=!1,v.length?p=v.concat(p):y=-1,p.length&&c())}function c(){if(!d){var t=i(u);d=!0;for(var n=p.length;n;){for(v=p,p=[];++y<n;)v&&v[y].run();y=-1,n=p.length}v=null,d=!1,o(t)}}function f(t,n){this.fun=t,this.array=n}function a(){}var s,l,h=t.exports={};!function(){try{s="function"==typeof setTimeout?setTimeout:r}catch(t){s=r}try{l="function"==typeof clearTimeout?clearTimeout:e}catch(t){l=e}}();var v,p=[],d=!1,y=-1;h.nextTick=function(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)n[r-1]=arguments[r];p.push(new f(t,n)),1!==p.length||d||i(c)},f.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=a,h.addListener=a,h.once=a,h.off=a,h.removeListener=a,h.removeAllListeners=a,h.emit=a,h.prependListener=a,h.prependOnceListener=a,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,n,r){var e=r(45);t.exports=function(t,n){if("number"!=typeof t&&"Number"!=e(t))throw TypeError(n);return+t}},function(t,n,r){"use strict";var e=r(17),i=r(75),o=r(16);t.exports=[].copyWithin||function(t,n){var r=e(this),u=o(r.length),c=i(t,u),f=i(n,u),a=arguments.length>2?arguments[2]:void 0,s=Math.min((void 0===a?u:i(a,u))-f,u-c),l=1;for(f<c&&c<f+s&&(l=-1,f+=s-1,c+=s-1);s-- >0;)f in r?r[c]=r[f]:delete r[c],c+=l,f+=l;return r}},function(t,n,r){var e=r(79);t.exports=function(t,n){var r=[];return e(t,!1,r.push,r,n),r}},function(t,n,r){var e=r(26),i=r(17),o=r(115),u=r(16);t.exports=function(t,n,r,c,f){e(n);var a=i(t),s=o(a),l=u(a.length),h=f?l-1:0,v=f?-1:1;if(r<2)for(;;){if(h in s){c=s[h],h+=v;break}if(h+=v,f?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;f?h>=0:l>h;h+=v)h in s&&(c=n(c,s[h],h,a));return c}},function(t,n,r){"use strict";var e=r(26),i=r(6),o=r(121),u=[].slice,c={},f=function(t,n,r){if(!(n in c)){for(var e=[],i=0;i<n;i++)e[i]="a["+i+"]";c[n]=Function("F,a","return new F("+e.join(",")+")")}return c[n](t,r)};t.exports=Function.bind||function(t){var n=e(this),r=u.call(arguments,1),c=function(){var e=r.concat(u.call(arguments));return this instanceof c?f(n,e.length,e):o(n,e,t)};return i(n.prototype)&&(c.prototype=n.prototype),c}},function(t,n,r){"use strict";var e=r(11).f,i=r(70),o=r(73),u=r(53),c=r(68),f=r(46),a=r(79),s=r(140),l=r(170),h=r(74),v=r(10),p=r(65).fastKey,d=v?"_s":"size",y=function(t,n){var r,e=p(n);if("F"!==e)return t._i[e];for(r=t._f;r;r=r.n)if(r.k==n)return r};t.exports={getConstructor:function(t,n,r,s){var l=t(function(t,e){c(t,l,n,"_i"),t._i=i(null),t._f=void 0,t._l=void 0,t[d]=0,void 0!=e&&a(e,r,t[s],t)});return o(l.prototype,{clear:function(){for(var t=this,n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[d]=0},delete:function(t){var n=this,r=y(n,t);if(r){var e=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=e),e&&(e.p=i),n._f==r&&(n._f=e),n._l==r&&(n._l=i),n[d]--}return!!r},forEach:function(t){c(this,l,"forEach");for(var n,r=u(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!y(this,t)}}),v&&e(l.prototype,"size",{get:function(){return f(this[d])}}),l},def:function(t,n,r){var e,i,o=y(t,n);return o?o.v=r:(t._l=o={i:i=p(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[d]++,"F"!==i&&(t._i[i]=o)),t},getEntry:y,setStrong:function(t,n,r){s(t,n,function(t,n){this._t=t,this._k=n,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==n?l(0,r.k):"values"==n?l(0,r.v):l(0,[r.k,r.v]):(t._t=void 0,l(1))},r?"entries":"values",!r,!0),h(n)}}},function(t,n,r){var e=r(114),i=r(161);t.exports=function(t){return function(){if(e(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},function(t,n,r){"use strict";var e=r(73),i=r(65).getWeak,o=r(2),u=r(6),c=r(68),f=r(79),a=r(48),s=r(24),l=a(5),h=a(6),v=0,p=function(t){return t._l||(t._l=new d)},d=function(){this.a=[]},y=function(t,n){return l(t.a,function(t){return t[0]===n})};d.prototype={get:function(t){var n=y(this,t);if(n)return n[1]},has:function(t){return!!y(this,t)},set:function(t,n){var r=y(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(t){var n=h(this.a,function(n){return n[0]===t});return~n&&this.a.splice(n,1),!!~n}},t.exports={getConstructor:function(t,n,r,o){var a=t(function(t,e){c(t,a,n,"_i"),t._i=v++,t._l=void 0,void 0!=e&&f(e,r,t[o],t)});return e(a.prototype,{delete:function(t){if(!u(t))return!1;var n=i(t);return!0===n?p(this).delete(t):n&&s(n,this._i)&&delete n[this._i]},has:function(t){if(!u(t))return!1;var n=i(t);return!0===n?p(this).has(t):n&&s(n,this._i)}}),a},def:function(t,n,r){var e=i(o(n),!0);return!0===e?p(t).set(n,r):e[t._i]=r,t},ufstore:p}},function(t,n,r){t.exports=!r(10)&&!r(4)(function(){return 7!=Object.defineProperty(r(132)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(6),i=Math.floor;t.exports=function(t){return!e(t)&&isFinite(t)&&i(t)===t}},function(t,n,r){var e=r(2);t.exports=function(t,n,r,i){try{return i?n(e(r)[0],r[1]):n(r)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){"use strict";var e=r(72),i=r(125),o=r(116),u=r(17),c=r(115),f=Object.assign;t.exports=!f||r(4)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=f({},t)[r]||Object.keys(f({},n)).join("")!=e})?function(t,n){for(var r=u(t),f=arguments.length,a=1,s=i.f,l=o.f;f>a;)for(var h,v=c(arguments[a++]),p=s?e(v).concat(s(v)):e(v),d=p.length,y=0;d>y;)l.call(v,h=p[y++])&&(r[h]=v[h]);return r}:f},function(t,n,r){var e=r(11),i=r(2),o=r(72);t.exports=r(10)?Object.defineProperties:function(t,n){i(t);for(var r,u=o(n),c=u.length,f=0;c>f;)e.f(t,r=u[f++],n[r]);return t}},function(t,n,r){var e=r(30),i=r(71).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return i(t)}catch(t){return u.slice()}};t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?c(t):i(e(t))}},function(t,n,r){var e=r(24),i=r(30),o=r(117)(!1),u=r(145)("IE_PROTO");t.exports=function(t,n){var r,c=i(t),f=0,a=[];for(r in c)r!=u&&e(c,r)&&a.push(r);for(;n.length>f;)e(c,r=n[f++])&&(~o(a,r)||a.push(r));return a}},function(t,n,r){var e=r(72),i=r(30),o=r(116).f;t.exports=function(t){return function(n){for(var r,u=i(n),c=e(u),f=c.length,a=0,s=[];f>a;)o.call(u,r=c[a++])&&s.push(t?[r,u[r]]:u[r]);return s}}},function(t,n,r){var e=r(71),i=r(125),o=r(2),u=r(3).Reflect;t.exports=u&&u.ownKeys||function(t){var n=e.f(o(t)),r=i.f;return r?n.concat(r(t)):n}},function(t,n,r){var e=r(3).parseFloat,i=r(82).trim;t.exports=1/e(r(150)+"-0")!=-1/0?function(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},function(t,n,r){var e=r(3).parseInt,i=r(82).trim,o=r(150),u=/^[\-+]?0[xX]/;t.exports=8!==e(o+"08")||22!==e(o+"0x16")?function(t,n){var r=i(String(t),3);return e(r,n>>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=Object.is||function(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}},function(t,n,r){var e=r(16),i=r(149),o=r(46);t.exports=function(t,n,r,u){var c=String(o(t)),f=c.length,a=void 0===r?" ":String(r),s=e(n);if(s<=f||""==a)return c;var l=s-f,h=i.call(a,Math.ceil(l/a.length));return h.length>l&&(h=h.slice(0,l)),u?h+c:c+h}},function(t,n,r){n.f=r(7)},function(t,n,r){"use strict";var e=r(164);t.exports=r(118)("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var n=e.getEntry(this,t);return n&&n.v},set:function(t,n){return e.def(this,0===t?0:t,n)}},e,!0)},function(t,n,r){r(10)&&"g"!=/./g.flags&&r(11).f(RegExp.prototype,"flags",{configurable:!0,get:r(120)})},function(t,n,r){"use strict";var e=r(164);t.exports=r(118)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return e.def(this,t=0===t?0:t,t)}},e)},function(t,n,r){"use strict";var e,i=r(48)(0),o=r(28),u=r(65),c=r(172),f=r(166),a=r(6),s=u.getWeak,l=Object.isExtensible,h=f.ufstore,v={},p=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},d={get:function(t){if(a(t)){var n=s(t);return!0===n?h(this).get(t):n?n[this._i]:void 0}},set:function(t,n){return f.def(this,t,n)}},y=t.exports=r(118)("WeakMap",p,d,f,!0,!0);7!=(new y).set((Object.freeze||Object)(v),7).get(v)&&(e=f.getConstructor(p),c(e.prototype,d),u.NEED=!0,i(["delete","has","get","set"],function(t){var n=y.prototype,r=n[t];o(n,t,function(n,i){if(a(n)&&!l(n)){this._f||(this._f=new e);var o=this._f[t](n,i);return"set"==t?this:o}return r.call(this,n,i)})}))},,,,function(t,n){"use strict";function r(){var t=document.querySelector("#page-nav");if(t&&!document.querySelector("#page-nav .extend.prev")&&(t.innerHTML='<a class="extend prev disabled" rel="prev">&laquo; Prev</a>'+t.innerHTML),t&&!document.querySelector("#page-nav .extend.next")&&(t.innerHTML=t.innerHTML+'<a class="extend next disabled" rel="next">Next &raquo;</a>'),yiliaConfig&&yiliaConfig.open_in_new){document.querySelectorAll(".article-entry a:not(.article-more-a)").forEach(function(t){var n=t.getAttribute("target");n&&""!==n||t.setAttribute("target","_blank")})}if(yiliaConfig&&yiliaConfig.open_in_new){document.querySelectorAll(".toc-number").forEach(function(t){t.style.display="none"})}var n=document.querySelector("#js-aboutme");n&&0!==n.length&&(n.innerHTML=n.innerText)}t.exports={init:r}},function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{default:t}}function i(t,n){var r=/\/|index.html/g;return t.replace(r,"")===n.replace(r,"")}function o(){for(var t=document.querySelectorAll(".js-header-menu li a"),n=window.location.pathname,r=0,e=t.length;r<e;r++){var o=t[r];i(n,o.getAttribute("href"))&&(0,h.default)(o,"active")}}function u(t){for(var n=t.offsetLeft,r=t.offsetParent;null!==r;)n+=r.offsetLeft,r=r.offsetParent;return n}function c(t){for(var n=t.offsetTop,r=t.offsetParent;null!==r;)n+=r.offsetTop,r=r.offsetParent;return n}function f(t,n,r,e,i){var o=u(t),f=c(t)-n;if(f-r<=i){var a=t.$newDom;a||(a=t.cloneNode(!0),(0,d.default)(t,a),t.$newDom=a,a.style.position="fixed",a.style.top=(r||f)+"px",a.style.left=o+"px",a.style.zIndex=e||2,a.style.width="100%",a.style.color="#fff"),a.style.visibility="visible",t.style.visibility="hidden"}else{t.style.visibility="visible";var s=t.$newDom;s&&(s.style.visibility="hidden")}}function a(){var t=document.querySelector(".js-overlay"),n=document.querySelector(".js-header-menu");f(t,document.body.scrollTop,-63,2,0),f(n,document.body.scrollTop,1,3,0)}function s(){document.querySelector("#container").addEventListener("scroll",function(t){a()}),window.addEventListener("scroll",function(t){a()}),a()}var l=r(156),h=e(l),v=r(157),p=(e(v),r(382)),d=e(p),y=r(128),g=e(y),b=r(190),m=e(b),x=r(129);(function(){g.default.versions.mobile&&window.screen.width<800&&(o(),s())})(),(0,x.addLoadEvent)(function(){m.default.init()}),t.exports={}},,,,function(t,n,r){(function(t){"use strict";function n(t,n,r){t[n]||Object[e](t,n,{writable:!0,configurable:!0,value:r})}if(r(381),r(391),r(198),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;var e="defineProperty";n(String.prototype,"padLeft","".padStart),n(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(t){[][t]&&n(Array,t,Function.call.bind([][t]))})}).call(n,function(){return this}())},,,function(t,n,r){r(210),t.exports=r(52).RegExp.escape},,,,function(t,n,r){var e=r(6),i=r(138),o=r(7)("species");t.exports=function(t){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&null===(n=n[o])&&(n=void 0)),void 0===n?Array:n}},function(t,n,r){var e=r(202);t.exports=function(t,n){return new(e(t))(n)}},function(t,n,r){"use strict";var e=r(2),i=r(50),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),t!=o)}},function(t,n,r){var e=r(72),i=r(125),o=r(116);t.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),f=o.f,a=0;c.length>a;)f.call(t,u=c[a++])&&n.push(u);return n}},function(t,n,r){var e=r(72),i=r(30);t.exports=function(t,n){for(var r,o=i(t),u=e(o),c=u.length,f=0;c>f;)if(o[r=u[f++]]===n)return r}},function(t,n,r){"use strict";var e=r(208),i=r(121),o=r(26);t.exports=function(){for(var t=o(this),n=arguments.length,r=Array(n),u=0,c=e._,f=!1;n>u;)(r[u]=arguments[u++])===c&&(f=!0);return function(){var e,o=this,u=arguments.length,a=0,s=0;if(!f&&!u)return i(t,r,o);if(e=r.slice(),f)for(;n>a;a++)e[a]===c&&(e[a]=arguments[s++]);for(;u>s;)e.push(arguments[s++]);return i(t,e,o)}}},function(t,n,r){t.exports=r(3)},function(t,n){t.exports=function(t,n){var r=n===Object(n)?function(t){return n[t]}:n;return function(n){return String(n).replace(t,r)}}},function(t,n,r){var e=r(1),i=r(209)(/[\\^$*+?.()|[\]{}]/g,"\\$&");e(e.S,"RegExp",{escape:function(t){return i(t)}})},function(t,n,r){var e=r(1);e(e.P,"Array",{copyWithin:r(160)}),r(78)("copyWithin")},function(t,n,r){"use strict";var e=r(1),i=r(48)(4);e(e.P+e.F*!r(47)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},function(t,n,r){var e=r(1);e(e.P,"Array",{fill:r(130)}),r(78)("fill")},function(t,n,r){"use strict";var e=r(1),i=r(48)(2);e(e.P+e.F*!r(47)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},function(t,n,r){"use strict";var e=r(1),i=r(48)(6),o="findIndex",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),r(78)(o)},function(t,n,r){"use strict";var e=r(1),i=r(48)(5),o="find",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),r(78)(o)},function(t,n,r){"use strict";var e=r(1),i=r(48)(0),o=r(47)([].forEach,!0);e(e.P+e.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},function(t,n,r){"use strict";var e=r(53),i=r(1),o=r(17),u=r(169),c=r(137),f=r(16),a=r(131),s=r(154);i(i.S+i.F*!r(123)(function(t){Array.from(t)}),"Array",{from:function(t){var n,r,i,l,h=o(t),v="function"==typeof this?this:Array,p=arguments.length,d=p>1?arguments[1]:void 0,y=void 0!==d,g=0,b=s(h);if(y&&(d=e(d,p>2?arguments[2]:void 0,2)),void 0==b||v==Array&&c(b))for(n=f(h.length),r=new v(n);n>g;g++)a(r,g,y?d(h[g],g):h[g]);else for(l=b.call(h),r=new v;!(i=l.next()).done;g++)a(r,g,y?u(l,d,[i.value,g],!0):i.value);return r.length=g,r}})},function(t,n,r){"use strict";var e=r(1),i=r(117)(!1),o=[].indexOf,u=!!o&&1/[1].indexOf(1,-0)<0;e(e.P+e.F*(u||!r(47)(o)),"Array",{indexOf:function(t){return u?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},function(t,n,r){var e=r(1);e(e.S,"Array",{isArray:r(138)})},function(t,n,r){"use strict";var e=r(1),i=r(30),o=[].join;e(e.P+e.F*(r(115)!=Object||!r(47)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},function(t,n,r){"use strict";var e=r(1),i=r(30),o=r(67),u=r(16),c=[].lastIndexOf,f=!!c&&1/[1].lastIndexOf(1,-0)<0;e(e.P+e.F*(f||!r(47)(c)),"Array",{lastIndexOf:function(t){if(f)return c.apply(this,arguments)||0;var n=i(this),r=u(n.length),e=r-1;for(arguments.length>1&&(e=Math.min(e,o(arguments[1]))),e<0&&(e=r+e);e>=0;e--)if(e in n&&n[e]===t)return e||0;return-1}})},function(t,n,r){"use strict";var e=r(1),i=r(48)(1);e(e.P+e.F*!r(47)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},function(t,n,r){"use strict";var e=r(1),i=r(131);e(e.S+e.F*r(4)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,n=arguments.length,r=new("function"==typeof this?this:Array)(n);n>t;)i(r,t,arguments[t++]);return r.length=n,r}})},function(t,n,r){"use strict";var e=r(1),i=r(162);e(e.P+e.F*!r(47)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},function(t,n,r){"use strict";var e=r(1),i=r(162);e(e.P+e.F*!r(47)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},function(t,n,r){"use strict";var e=r(1),i=r(135),o=r(45),u=r(75),c=r(16),f=[].slice;e(e.P+e.F*r(4)(function(){i&&f.call(i)}),"Array",{slice:function(t,n){var r=c(this.length),e=o(this);if(n=void 0===n?r:n,"Array"==e)return f.call(this,t,n);for(var i=u(t,r),a=u(n,r),s=c(a-i),l=Array(s),h=0;h<s;h++)l[h]="String"==e?this.charAt(i+h):this[i+h];return l}})},function(t,n,r){"use strict";var e=r(1),i=r(48)(3);e(e.P+e.F*!r(47)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},function(t,n,r){"use strict";var e=r(1),i=r(26),o=r(17),u=r(4),c=[].sort,f=[1,2,3];e(e.P+e.F*(u(function(){f.sort(void 0)})||!u(function(){f.sort(null)})||!r(47)(c)),"Array",{sort:function(t){return void 0===t?c.call(o(this)):c.call(o(this),i(t))}})},function(t,n,r){r(74)("Array")},function(t,n,r){var e=r(1);e(e.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,n,r){"use strict";var e=r(1),i=r(4),o=Date.prototype.getTime,u=function(t){return t>9?t:"0"+t};e(e.P+e.F*(i(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!i(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function(){
if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":n>9999?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(r>99?r:"0"+u(r))+"Z"}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(50);e(e.P+e.F*r(4)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(t){var n=i(this),r=o(n);return"number"!=typeof r||isFinite(r)?n.toISOString():null}})},function(t,n,r){var e=r(7)("toPrimitive"),i=Date.prototype;e in i||r(27)(i,e,r(204))},function(t,n,r){var e=Date.prototype,i="Invalid Date",o="toString",u=e[o],c=e.getTime;new Date(NaN)+""!=i&&r(28)(e,o,function(){var t=c.call(this);return t===t?u.call(this):i})},function(t,n,r){var e=r(1);e(e.P,"Function",{bind:r(163)})},function(t,n,r){"use strict";var e=r(6),i=r(32),o=r(7)("hasInstance"),u=Function.prototype;o in u||r(11).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},function(t,n,r){var e=r(11).f,i=r(66),o=r(24),u=Function.prototype,c="name",f=Object.isExtensible||function(){return!0};c in u||r(10)&&e(u,c,{configurable:!0,get:function(){try{var t=this,n=(""+t).match(/^\s*function ([^ (]*)/)[1];return o(t,c)||!f(t)||e(t,c,i(5,n)),n}catch(t){return""}}})},function(t,n,r){var e=r(1),i=r(171),o=Math.sqrt,u=Math.acosh;e(e.S+e.F*!(u&&710==Math.floor(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},function(t,n,r){function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}var i=r(1),o=Math.asinh;i(i.S+i.F*!(o&&1/o(0)>0),"Math",{asinh:e})},function(t,n,r){var e=r(1),i=Math.atanh;e(e.S+e.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,n,r){var e=r(1),i=r(142);e(e.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,n,r){var e=r(1);e(e.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(1),i=Math.exp;e(e.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(1),i=r(141);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(1),i=r(142),o=Math.pow,u=o(2,-52),c=o(2,-23),f=o(2,127)*(2-c),a=o(2,-126),s=function(t){return t+1/u-1/u};e(e.S,"Math",{fround:function(t){var n,r,e=Math.abs(t),o=i(t);return e<a?o*s(e/a/c)*a*c:(n=(1+c/u)*e,r=n-(n-e),r>f||r!=r?o*(1/0):o*r)}})},function(t,n,r){var e=r(1),i=Math.abs;e(e.S,"Math",{hypot:function(t,n){for(var r,e,o=0,u=0,c=arguments.length,f=0;u<c;)r=i(arguments[u++]),f<r?(e=f/r,o=o*e*e+1,f=r):r>0?(e=r/f,o+=e*e):o+=r;return f===1/0?1/0:f*Math.sqrt(o)}})},function(t,n,r){var e=r(1),i=Math.imul;e(e.S+e.F*r(4)(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function(t,n){var r=65535,e=+t,i=+n,o=r&e,u=r&i;return 0|o*u+((r&e>>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(1);e(e.S,"Math",{log10:function(t){return Math.log(t)/Math.LN10}})},function(t,n,r){var e=r(1);e(e.S,"Math",{log1p:r(171)})},function(t,n,r){var e=r(1);e(e.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(1);e(e.S,"Math",{sign:r(142)})},function(t,n,r){var e=r(1),i=r(141),o=Math.exp;e(e.S+e.F*r(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(1),i=r(141),o=Math.exp;e(e.S,"Math",{tanh:function(t){var n=i(t=+t),r=i(-t);return n==1/0?1:r==1/0?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(1);e(e.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,n,r){"use strict";var e=r(3),i=r(24),o=r(45),u=r(136),c=r(50),f=r(4),a=r(71).f,s=r(31).f,l=r(11).f,h=r(82).trim,v="Number",p=e[v],d=p,y=p.prototype,g=o(r(70)(y))==v,b="trim"in String.prototype,m=function(t){var n=c(t,!1);if("string"==typeof n&&n.length>2){n=b?n.trim():h(n,3);var r,e,i,o=n.charCodeAt(0);if(43===o||45===o){if(88===(r=n.charCodeAt(2))||120===r)return NaN}else if(48===o){switch(n.charCodeAt(1)){case 66:case 98:e=2,i=49;break;case 79:case 111:e=8,i=55;break;default:return+n}for(var u,f=n.slice(2),a=0,s=f.length;a<s;a++)if((u=f.charCodeAt(a))<48||u>i)return NaN;return parseInt(f,e)}}return+n};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var n=arguments.length<1?0:t,r=this;return r instanceof p&&(g?f(function(){y.valueOf.call(r)}):o(r)!=v)?u(new d(m(n)),r,p):m(n)};for(var x,w=r(10)?a(d):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;w.length>S;S++)i(d,x=w[S])&&!i(p,x)&&l(p,x,s(d,x));p.prototype=y,y.constructor=p,r(28)(e,v,p)}},function(t,n,r){var e=r(1);e(e.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,n,r){var e=r(1),i=r(3).isFinite;e(e.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},function(t,n,r){var e=r(1);e(e.S,"Number",{isInteger:r(168)})},function(t,n,r){var e=r(1);e(e.S,"Number",{isNaN:function(t){return t!=t}})},function(t,n,r){var e=r(1),i=r(168),o=Math.abs;e(e.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},function(t,n,r){var e=r(1);e(e.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,n,r){var e=r(1);e(e.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,n,r){var e=r(1),i=r(178);e(e.S+e.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(t,n,r){var e=r(1),i=r(179);e(e.S+e.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(t,n,r){"use strict";var e=r(1),i=r(67),o=r(159),u=r(149),c=1..toFixed,f=Math.floor,a=[0,0,0,0,0,0],s="Number.toFixed: incorrect invocation!",l="0",h=function(t,n){for(var r=-1,e=n;++r<6;)e+=t*a[r],a[r]=e%1e7,e=f(e/1e7)},v=function(t){for(var n=6,r=0;--n>=0;)r+=a[n],a[n]=f(r/t),r=r%t*1e7},p=function(){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==a[t]){var r=String(a[t]);n=""===n?r:n+u.call(l,7-r.length)+r}return n},d=function(t,n,r){return 0===n?r:n%2==1?d(t,n-1,r*t):d(t*t,n/2,r)},y=function(t){for(var n=0,r=t;r>=4096;)n+=12,r/=4096;for(;r>=2;)n+=1,r/=2;return n};e(e.P+e.F*(!!c&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r(4)(function(){c.call({})})),"Number",{toFixed:function(t){var n,r,e,c,f=o(this,s),a=i(t),g="",b=l;if(a<0||a>20)throw RangeError(s);if(f!=f)return"NaN";if(f<=-1e21||f>=1e21)return String(f);if(f<0&&(g="-",f=-f),f>1e-21)if(n=y(f*d(2,69,1))-69,r=n<0?f*d(2,-n,1):f/d(2,n,1),r*=4503599627370496,(n=52-n)>0){for(h(0,r),e=a;e>=7;)h(1e7,0),e-=7;for(h(d(10,e,1),0),e=n-1;e>=23;)v(1<<23),e-=23;v(1<<e),h(1,1),v(2),b=p()}else h(0,r),h(1<<-n,0),b=p()+u.call(l,a);return a>0?(c=b.length,b=g+(c<=a?"0."+u.call(l,a-c)+b:b.slice(0,c-a)+"."+b.slice(c-a))):b=g+b,b}})},function(t,n,r){"use strict";var e=r(1),i=r(4),o=r(159),u=1..toPrecision;e(e.P+e.F*(i(function(){return"1"!==u.call(1,void 0)})||!i(function(){u.call({})})),"Number",{toPrecision:function(t){var n=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?u.call(n):u.call(n,t)}})},function(t,n,r){var e=r(1);e(e.S+e.F,"Object",{assign:r(172)})},function(t,n,r){var e=r(1);e(e.S,"Object",{create:r(70)})},function(t,n,r){var e=r(1);e(e.S+e.F*!r(10),"Object",{defineProperties:r(173)})},function(t,n,r){var e=r(1);e(e.S+e.F*!r(10),"Object",{defineProperty:r(11).f})},function(t,n,r){var e=r(6),i=r(65).onFreeze;r(49)("freeze",function(t){return function(n){return t&&e(n)?t(i(n)):n}})},function(t,n,r){var e=r(30),i=r(31).f;r(49)("getOwnPropertyDescriptor",function(){return function(t,n){return i(e(t),n)}})},function(t,n,r){r(49)("getOwnPropertyNames",function(){return r(174).f})},function(t,n,r){var e=r(17),i=r(32);r(49)("getPrototypeOf",function(){return function(t){return i(e(t))}})},function(t,n,r){var e=r(6);r(49)("isExtensible",function(t){return function(n){return!!e(n)&&(!t||t(n))}})},function(t,n,r){var e=r(6);r(49)("isFrozen",function(t){return function(n){return!e(n)||!!t&&t(n)}})},function(t,n,r){var e=r(6);r(49)("isSealed",function(t){return function(n){return!e(n)||!!t&&t(n)}})},function(t,n,r){var e=r(1);e(e.S,"Object",{is:r(180)})},function(t,n,r){var e=r(17),i=r(72);r(49)("keys",function(){return function(t){return i(e(t))}})},function(t,n,r){var e=r(6),i=r(65).onFreeze;r(49)("preventExtensions",function(t){return function(n){return t&&e(n)?t(i(n)):n}})},function(t,n,r){var e=r(6),i=r(65).onFreeze;r(49)("seal",function(t){return function(n){return t&&e(n)?t(i(n)):n}})},function(t,n,r){var e=r(1);e(e.S,"Object",{setPrototypeOf:r(144).set})},function(t,n,r){"use strict";var e=r(114),i={};i[r(7)("toStringTag")]="z",i+""!="[object z]"&&r(28)(Object.prototype,"toString",function(){return"[object "+e(this)+"]"},!0)},function(t,n,r){var e=r(1),i=r(178);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},function(t,n,r){var e=r(1),i=r(179);e(e.G+e.F*(parseInt!=i),{parseInt:i})},function(t,n,r){"use strict";var e,i,o,u=r(69),c=r(3),f=r(53),a=r(114),s=r(1),l=r(6),h=r(26),v=r(68),p=r(79),d=r(146),y=r(151).set,g=r(143)(),b="Promise",m=c.TypeError,x=c.process,w=c[b],x=c.process,S="process"==a(x),_=function(){},O=!!function(){try{var t=w.resolve(1),n=(t.constructor={})[r(7)("species")]=function(t){t(_,_)};return(S||"function"==typeof PromiseRejectionEvent)&&t.then(_)instanceof n}catch(t){}}(),E=function(t,n){return t===n||t===w&&n===o},P=function(t){var n;return!(!l(t)||"function"!=typeof(n=t.then))&&n},j=function(t){return E(w,t)?new F(t):new i(t)},F=i=function(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw m("Bad Promise constructor");n=t,r=e}),this.resolve=h(n),this.reject=h(r)},M=function(t){try{t()}catch(t){return{error:t}}},A=function(t,n){if(!t._n){t._n=!0;var r=t._c;g(function(){for(var e=t._v,i=1==t._s,o=0;r.length>o;)!function(n){var r,o,u=i?n.ok:n.fail,c=n.resolve,f=n.reject,a=n.domain;try{u?(i||(2==t._h&&I(t),t._h=1),!0===u?r=e:(a&&a.enter(),r=u(e),a&&a.exit()),r===n.promise?f(m("Promise-chain cycle")):(o=P(r))?o.call(r,c,f):c(r)):f(e)}catch(t){f(t)}}(r[o++]);t._c=[],t._n=!1,n&&!t._h&&N(t)})}},N=function(t){y.call(c,function(){var n,r,e,i=t._v;if(T(t)&&(n=M(function(){S?x.emit("unhandledRejection",i,t):(r=c.onunhandledrejection)?r({promise:t,reason:i}):(e=c.console)&&e.error&&e.error("Unhandled promise rejection",i)}),t._h=S||T(t)?2:1),t._a=void 0,n)throw n.error})},T=function(t){if(1==t._h)return!1;for(var n,r=t._a||t._c,e=0;r.length>e;)if(n=r[e++],n.fail||!T(n.promise))return!1;return!0},I=function(t){y.call(c,function(){var n;S?x.emit("rejectionHandled",t):(n=c.onrejectionhandled)&&n({promise:t,reason:t._v})})},k=function(t){var n=this;n._d||(n._d=!0,n=n._w||n,n._v=t,n._s=2,n._a||(n._a=n._c.slice()),A(n,!0))},L=function(t){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw m("Promise can't be resolved itself");(n=P(t))?g(function(){var e={_w:r,_d:!1};try{n.call(t,f(L,e,1),f(k,e,1))}catch(t){k.call(e,t)}}):(r._v=t,r._s=1,A(r,!1))}catch(t){k.call({_w:r,_d:!1},t)}}};O||(w=function(t){v(this,w,b,"_h"),h(t),e.call(this);try{t(f(L,this,1),f(k,this,1))}catch(t){k.call(this,t)}},e=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=r(73)(w.prototype,{then:function(t,n){var r=j(d(this,w));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=S?x.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&A(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),F=function(){var t=new e;this.promise=t,this.resolve=f(L,t,1),this.reject=f(k,t,1)}),s(s.G+s.W+s.F*!O,{Promise:w}),r(81)(w,b),r(74)(b),o=r(52)[b],s(s.S+s.F*!O,b,{reject:function(t){var n=j(this);return(0,n.reject)(t),n.promise}}),s(s.S+s.F*(u||!O),b,{resolve:function(t){if(t instanceof w&&E(t.constructor,this))return t;var n=j(this);return(0,n.resolve)(t),n.promise}}),s(s.S+s.F*!(O&&r(123)(function(t){w.all(t).catch(_)})),b,{all:function(t){var n=this,r=j(n),e=r.resolve,i=r.reject,o=M(function(){var r=[],o=0,u=1;p(t,!1,function(t){var c=o++,f=!1;r.push(void 0),u++,n.resolve(t).then(function(t){f||(f=!0,r[c]=t,--u||e(r))},i)}),--u||e(r)});return o&&i(o.error),r.promise},race:function(t){var n=this,r=j(n),e=r.reject,i=M(function(){p(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i&&e(i.error),r.promise}})},function(t,n,r){var e=r(1),i=r(26),o=r(2),u=(r(3).Reflect||{}).apply,c=Function.apply;e(e.S+e.F*!r(4)(function(){u(function(){})}),"Reflect",{apply:function(t,n,r){var e=i(t),f=o(r);return u?u(e,n,f):c.call(e,n,f)}})},function(t,n,r){var e=r(1),i=r(70),o=r(26),u=r(2),c=r(6),f=r(4),a=r(163),s=(r(3).Reflect||{}).construct,l=f(function(){function t(){}return!(s(function(){},[],t)instanceof t)}),h=!f(function(){s(function(){})});e(e.S+e.F*(l||h),"Reflect",{construct:function(t,n){o(t),u(n);var r=arguments.length<3?t:o(arguments[2]);if(h&&!l)return s(t,n,r);if(t==r){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var e=[null];return e.push.apply(e,n),new(a.apply(t,e))}var f=r.prototype,v=i(c(f)?f:Object.prototype),p=Function.apply.call(t,v,n);return c(p)?p:v}})},function(t,n,r){var e=r(11),i=r(1),o=r(2),u=r(50);i(i.S+i.F*r(4)(function(){Reflect.defineProperty(e.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,n,r){o(t),n=u(n,!0),o(r);try{return e.f(t,n,r),!0}catch(t){return!1}}})},function(t,n,r){var e=r(1),i=r(31).f,o=r(2);e(e.S,"Reflect",{deleteProperty:function(t,n){var r=i(o(t),n);return!(r&&!r.configurable)&&delete t[n]}})},function(t,n,r){"use strict";var e=r(1),i=r(2),o=function(t){this._t=i(t),this._i=0;var n,r=this._k=[];for(n in t)r.push(n)};r(139)(o,"Object",function(){var t,n=this,r=n._k;do{if(n._i>=r.length)return{value:void 0,done:!0}}while(!((t=r[n._i++])in n._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,n,r){var e=r(31),i=r(1),o=r(2);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,n){return e.f(o(t),n)}})},function(t,n,r){var e=r(1),i=r(32),o=r(2);e(e.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},function(t,n,r){function e(t,n){var r,c,s=arguments.length<3?t:arguments[2];return a(t)===s?t[n]:(r=i.f(t,n))?u(r,"value")?r.value:void 0!==r.get?r.get.call(s):void 0:f(c=o(t))?e(c,n,s):void 0}var i=r(31),o=r(32),u=r(24),c=r(1),f=r(6),a=r(2);c(c.S,"Reflect",{get:e})},function(t,n,r){var e=r(1);e(e.S,"Reflect",{has:function(t,n){return n in t}})},function(t,n,r){var e=r(1),i=r(2),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},function(t,n,r){var e=r(1);e(e.S,"Reflect",{ownKeys:r(177)})},function(t,n,r){var e=r(1),i=r(2),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,n,r){var e=r(1),i=r(144);i&&e(e.S,"Reflect",{setPrototypeOf:function(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(t){return!1}}})},function(t,n,r){function e(t,n,r){var f,h,v=arguments.length<4?t:arguments[3],p=o.f(s(t),n);if(!p){if(l(h=u(t)))return e(h,n,r,v);p=a(0)}return c(p,"value")?!(!1===p.writable||!l(v)||(f=o.f(v,n)||a(0),f.value=r,i.f(v,n,f),0)):void 0!==p.set&&(p.set.call(v,r),!0)}var i=r(11),o=r(31),u=r(32),c=r(24),f=r(1),a=r(66),s=r(2),l=r(6);f(f.S,"Reflect",{set:e})},function(t,n,r){var e=r(3),i=r(136),o=r(11).f,u=r(71).f,c=r(122),f=r(120),a=e.RegExp,s=a,l=a.prototype,h=/a/g,v=/a/g,p=new a(h)!==h;if(r(10)&&(!p||r(4)(function(){return v[r(7)("match")]=!1,a(h)!=h||a(v)==v||"/a/i"!=a(h,"i")}))){a=function(t,n){var r=this instanceof a,e=c(t),o=void 0===n;return!r&&e&&t.constructor===a&&o?t:i(p?new s(e&&!o?t.source:t,n):s((e=t instanceof a)?t.source:t,e&&o?f.call(t):n),r?this:l,a)};for(var d=u(s),y=0;d.length>y;)!function(t){t in a||o(a,t,{configurable:!0,get:function(){return s[t]},set:function(n){s[t]=n}})}(d[y++]);l.constructor=a,a.prototype=l,r(28)(e,"RegExp",a)}r(74)("RegExp")},function(t,n,r){r(119)("match",1,function(t,n,r){return[function(r){"use strict";var e=t(this),i=void 0==r?void 0:r[n];return void 0!==i?i.call(r,e):new RegExp(r)[n](String(e))},r]})},function(t,n,r){r(119)("replace",2,function(t,n,r){return[function(e,i){"use strict";var o=t(this),u=void 0==e?void 0:e[n];return void 0!==u?u.call(e,o,i):r.call(String(o),e,i)},r]})},function(t,n,r){r(119)("search",1,function(t,n,r){return[function(r){"use strict";var e=t(this),i=void 0==r?void 0:r[n];return void 0!==i?i.call(r,e):new RegExp(r)[n](String(e))},r]})},function(t,n,r){r(119)("split",2,function(t,n,e){"use strict";var i=r(122),o=e,u=[].push,c="split",f="length",a="lastIndex";if("c"=="abbc"[c](/(b)*/)[1]||4!="test"[c](/(?:)/,-1)[f]||2!="ab"[c](/(?:ab)*/)[f]||4!="."[c](/(.?)(.?)/)[f]||"."[c](/()()/)[f]>1||""[c](/.?/)[f]){var s=void 0===/()??/.exec("")[1];e=function(t,n){var r=String(this);if(void 0===t&&0===n)return[];if(!i(t))return o.call(r,t,n);var e,c,l,h,v,p=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),y=0,g=void 0===n?4294967295:n>>>0,b=new RegExp(t.source,d+"g");for(s||(e=new RegExp("^"+b.source+"$(?!\\s)",d));(c=b.exec(r))&&!((l=c.index+c[0][f])>y&&(p.push(r.slice(y,c.index)),!s&&c[f]>1&&c[0].replace(e,function(){for(v=1;v<arguments[f]-2;v++)void 0===arguments[v]&&(c[v]=void 0)}),c[f]>1&&c.index<r[f]&&u.apply(p,c.slice(1)),h=c[0][f],y=l,p[f]>=g));)b[a]===c.index&&b[a]++;return y===r[f]?!h&&b.test("")||p.push(""):p.push(r.slice(y)),p[f]>g?p.slice(0,g):p}}else"0"[c](void 0,0)[f]&&(e=function(t,n){return void 0===t&&0===n?[]:o.call(this,t,n)});return[function(r,i){var o=t(this),u=void 0==r?void 0:r[n];return void 0!==u?u.call(r,o,i):e.call(String(o),r,i)},e]})},function(t,n,r){"use strict";r(184);var e=r(2),i=r(120),o=r(10),u="toString",c=/./[u],f=function(t){r(28)(RegExp.prototype,u,t,!0)};r(4)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?f(function(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):c.name!=u&&f(function(){return c.call(this)})},function(t,n,r){"use strict";r(29)("anchor",function(t){return function(n){return t(this,"a","name",n)}})},function(t,n,r){"use strict";r(29)("big",function(t){return function(){return t(this,"big","","")}})},function(t,n,r){"use strict";r(29)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,n,r){"use strict";r(29)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,n,r){"use strict";var e=r(1),i=r(147)(!1);e(e.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,n,r){"use strict";var e=r(1),i=r(16),o=r(148),u="endsWith",c=""[u];e(e.P+e.F*r(134)(u),"String",{endsWith:function(t){var n=o(this,t,u),r=arguments.length>1?arguments[1]:void 0,e=i(n.length),f=void 0===r?e:Math.min(i(r),e),a=String(t);return c?c.call(n,a,f):n.slice(f-a.length,f)===a}})},function(t,n,r){"use strict";r(29)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,n,r){"use strict";r(29)("fontcolor",function(t){return function(n){return t(this,"font","color",n)}})},function(t,n,r){"use strict";r(29)("fontsize",function(t){return function(n){return t(this,"font","size",n)}})},function(t,n,r){var e=r(1),i=r(75),o=String.fromCharCode,u=String.fromCodePoint;e(e.S+e.F*(!!u&&1!=u.length),"String",{fromCodePoint:function(t){for(var n,r=[],e=arguments.length,u=0;e>u;){if(n=+arguments[u++],i(n,1114111)!==n)throw RangeError(n+" is not a valid code point");r.push(n<65536?o(n):o(55296+((n-=65536)>>10),n%1024+56320))}return r.join("")}})},function(t,n,r){"use strict";var e=r(1),i=r(148),o="includes";e(e.P+e.F*r(134)(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,n,r){"use strict";r(29)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,n,r){"use strict";var e=r(147)(!0);r(140)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},function(t,n,r){"use strict";r(29)("link",function(t){return function(n){return t(this,"a","href",n)}})},function(t,n,r){var e=r(1),i=r(30),o=r(16);e(e.S,"String",{raw:function(t){for(var n=i(t.raw),r=o(n.length),e=arguments.length,u=[],c=0;r>c;)u.push(String(n[c++])),c<e&&u.push(String(arguments[c]));return u.join("")}})},function(t,n,r){var e=r(1);e(e.P,"String",{repeat:r(149)})},function(t,n,r){"use strict";r(29)("small",function(t){return function(){return t(this,"small","","")}})},function(t,n,r){"use strict";var e=r(1),i=r(16),o=r(148),u="startsWith",c=""[u];e(e.P+e.F*r(134)(u),"String",{startsWith:function(t){var n=o(this,t,u),r=i(Math.min(arguments.length>1?arguments[1]:void 0,n.length)),e=String(t);return c?c.call(n,e,r):n.slice(r,r+e.length)===e}})},function(t,n,r){"use strict";r(29)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,n,r){"use strict";r(29)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,n,r){"use strict";r(29)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,n,r){"use strict";r(82)("trim",function(t){return function(){return t(this,3)}})},function(t,n,r){"use strict";var e=r(3),i=r(24),o=r(10),u=r(1),c=r(28),f=r(65).KEY,a=r(4),s=r(126),l=r(81),h=r(76),v=r(7),p=r(182),d=r(153),y=r(206),g=r(205),b=r(138),m=r(2),x=r(30),w=r(50),S=r(66),_=r(70),O=r(174),E=r(31),P=r(11),j=r(72),F=E.f,M=P.f,A=O.f,N=e.Symbol,T=e.JSON,I=T&&T.stringify,k="prototype",L=v("_hidden"),R=v("toPrimitive"),C={}.propertyIsEnumerable,D=s("symbol-registry"),U=s("symbols"),W=s("op-symbols"),G=Object[k],B="function"==typeof N,V=e.QObject,z=!V||!V[k]||!V[k].findChild,q=o&&a(function(){return 7!=_(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=F(G,n);e&&delete G[n],M(t,n,r),e&&t!==G&&M(G,n,e)}:M,K=function(t){var n=U[t]=_(N[k]);return n._k=t,n},J=B&&"symbol"==typeof N.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof N},Y=function(t,n,r){return t===G&&Y(W,n,r),m(t),n=w(n,!0),m(r),i(U,n)?(r.enumerable?(i(t,L)&&t[L][n]&&(t[L][n]=!1),r=_(r,{enumerable:S(0,!1)})):(i(t,L)||M(t,L,S(1,{})),t[L][n]=!0),q(t,n,r)):M(t,n,r)},H=function(t,n){m(t);for(var r,e=g(n=x(n)),i=0,o=e.length;o>i;)Y(t,r=e[i++],n[r]);return t},$=function(t,n){return void 0===n?_(t):H(_(t),n)},X=function(t){var n=C.call(this,t=w(t,!0));return!(this===G&&i(U,t)&&!i(W,t))&&(!(n||!i(this,t)||!i(U,t)||i(this,L)&&this[L][t])||n)},Q=function(t,n){if(t=x(t),n=w(n,!0),t!==G||!i(U,n)||i(W,n)){var r=F(t,n);return!r||!i(U,n)||i(t,L)&&t[L][n]||(r.enumerable=!0),r}},Z=function(t){for(var n,r=A(x(t)),e=[],o=0;r.length>o;)i(U,n=r[o++])||n==L||n==f||e.push(n);return e},tt=function(t){for(var n,r=t===G,e=A(r?W:x(t)),o=[],u=0;e.length>u;)!i(U,n=e[u++])||r&&!i(G,n)||o.push(U[n]);return o};B||(N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),n=function(r){this===G&&n.call(W,r),i(this,L)&&i(this[L],t)&&(this[L][t]=!1),q(this,t,S(1,r))};return o&&z&&q(G,t,{configurable:!0,set:n}),K(t)},c(N[k],"toString",function(){return this._k}),E.f=Q,P.f=Y,r(71).f=O.f=Z,r(116).f=X,r(125).f=tt,o&&!r(69)&&c(G,"propertyIsEnumerable",X,!0),p.f=function(t){return K(v(t))}),u(u.G+u.W+u.F*!B,{Symbol:N});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)v(nt[rt++]);for(var nt=j(v.store),rt=0;nt.length>rt;)d(nt[rt++]);u(u.S+u.F*!B,"Symbol",{for:function(t){return i(D,t+="")?D[t]:D[t]=N(t)},keyFor:function(t){if(J(t))return y(D,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){z=!0},useSimple:function(){z=!1}}),u(u.S+u.F*!B,"Object",{create:$,defineProperty:Y,defineProperties:H,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:tt}),T&&u(u.S+u.F*(!B||a(function(){var t=N();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!J(t)){for(var n,r,e=[t],i=1;arguments.length>i;)e.push(arguments[i++]);return n=e[1],"function"==typeof n&&(r=n),!r&&b(n)||(n=function(t,n){if(r&&(n=r.call(this,t,n)),!J(n))return n}),e[1]=n,I.apply(T,e)}}}),N[k][R]||r(27)(N[k],R,N[k].valueOf),l(N,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},function(t,n,r){"use strict";var e=r(1),i=r(127),o=r(152),u=r(2),c=r(75),f=r(16),a=r(6),s=r(3).ArrayBuffer,l=r(146),h=o.ArrayBuffer,v=o.DataView,p=i.ABV&&s.isView,d=h.prototype.slice,y=i.VIEW,g="ArrayBuffer";e(e.G+e.W+e.F*(s!==h),{ArrayBuffer:h}),e(e.S+e.F*!i.CONSTR,g,{isView:function(t){return p&&p(t)||a(t)&&y in t}}),e(e.P+e.U+e.F*r(4)(function(){return!new h(2).slice(1,void 0).byteLength}),g,{slice:function(t,n){if(void 0!==d&&void 0===n)return d.call(u(this),t);for(var r=u(this).byteLength,e=c(t,r),i=c(void 0===n?r:n,r),o=new(l(this,h))(f(i-e)),a=new v(this),s=new v(o),p=0;e<i;)s.setUint8(p++,a.getUint8(e++));return o}}),r(74)(g)},function(t,n,r){var e=r(1);e(e.G+e.W+e.F*!r(127).ABV,{DataView:r(152).DataView})},function(t,n,r){r(55)("Float32",4,function(t){return function(n,r,e){return t(this,n,r,e)}})},function(t,n,r){r(55)("Float64",8,function(t){return function(n,r,e){return t(this,n,r,e)}})},function(t,n,r){r(55)("Int16",2,function(t){return function(n,r,e){return t(this,n,r,e)}})},function(t,n,r){r(55)("Int32",4,function(t){return function(n,r,e){return t(this,n,r,e)}})},function(t,n,r){r(55)("Int8",1,function(t){return function(n,r,e){return t(this,n,r,e)}})},function(t,n,r){r(55)("Uint16",2,function(t){return function(n,r,e){return t(this,n,r,e)}})},function(t,n,r){r(55)("Uint32",4,function(t){return function(n,r,e){return t(this,n,r,e)}})},function(t,n,r){r(55)("Uint8",1,function(t){return function(n,r,e){return t(this,n,r,e)}})},function(t,n,r){r(55)("Uint8",1,function(t){return function(n,r,e){return t(this,n,r,e)}},!0)},function(t,n,r){"use strict";var e=r(166);r(118)("WeakSet",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return e.def(this,t,!0)}},e,!1,!0)},function(t,n,r){"use strict";var e=r(1),i=r(117)(!0);e(e.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),r(78)("includes")},function(t,n,r){var e=r(1),i=r(143)(),o=r(3).process,u="process"==r(45)(o);e(e.G,{asap:function(t){var n=u&&o.domain;i(n?n.bind(t):t)}})},function(t,n,r){var e=r(1),i=r(45);e(e.S,"Error",{isError:function(t){return"Error"===i(t)}})},function(t,n,r){var e=r(1);e(e.P+e.R,"Map",{toJSON:r(165)("Map")})},function(t,n,r){var e=r(1);e(e.S,"Math",{iaddh:function(t,n,r,e){var i=t>>>0,o=n>>>0,u=r>>>0;return o+(e>>>0)+((i&u|(i|u)&~(i+u>>>0))>>>31)|0}})},function(t,n,r){var e=r(1);e(e.S,"Math",{imulh:function(t,n){var r=65535,e=+t,i=+n,o=e&r,u=i&r,c=e>>16,f=i>>16,a=(c*u>>>0)+(o*u>>>16);return c*f+(a>>16)+((o*f>>>0)+(a&r)>>16)}})},function(t,n,r){var e=r(1);e(e.S,"Math",{isubh:function(t,n,r,e){var i=t>>>0,o=n>>>0,u=r>>>0;return o-(e>>>0)-((~i&u|~(i^u)&i-u>>>0)>>>31)|0}})},function(t,n,r){var e=r(1);e(e.S,"Math",{umulh:function(t,n){var r=65535,e=+t,i=+n,o=e&r,u=i&r,c=e>>>16,f=i>>>16,a=(c*u>>>0)+(o*u>>>16);return c*f+(a>>>16)+((o*f>>>0)+(a&r)>>>16)}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(26),u=r(11);r(10)&&e(e.P+r(124),"Object",{__defineGetter__:function(t,n){u.f(i(this),t,{get:o(n),enumerable:!0,configurable:!0})}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(26),u=r(11);r(10)&&e(e.P+r(124),"Object",{__defineSetter__:function(t,n){u.f(i(this),t,{set:o(n),enumerable:!0,configurable:!0})}})},function(t,n,r){var e=r(1),i=r(176)(!0);e(e.S,"Object",{entries:function(t){return i(t)}})},function(t,n,r){var e=r(1),i=r(177),o=r(30),u=r(31),c=r(131);e(e.S,"Object",{getOwnPropertyDescriptors:function(t){for(var n,r=o(t),e=u.f,f=i(r),a={},s=0;f.length>s;)c(a,n=f[s++],e(r,n));return a}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(50),u=r(32),c=r(31).f;r(10)&&e(e.P+r(124),"Object",{__lookupGetter__:function(t){var n,r=i(this),e=o(t,!0);do{if(n=c(r,e))return n.get}while(r=u(r))}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(50),u=r(32),c=r(31).f;r(10)&&e(e.P+r(124),"Object",{__lookupSetter__:function(t){var n,r=i(this),e=o(t,!0);do{if(n=c(r,e))return n.set}while(r=u(r))}})},function(t,n,r){var e=r(1),i=r(176)(!1);e(e.S,"Object",{values:function(t){return i(t)}})},function(t,n,r){"use strict";var e=r(1),i=r(3),o=r(52),u=r(143)(),c=r(7)("observable"),f=r(26),a=r(2),s=r(68),l=r(73),h=r(27),v=r(79),p=v.RETURN,d=function(t){return null==t?void 0:f(t)},y=function(t){var n=t._c;n&&(t._c=void 0,n())},g=function(t){return void 0===t._o},b=function(t){g(t)||(t._o=void 0,y(t))},m=function(t,n){a(t),this._c=void 0,this._o=t,t=new x(this);try{var r=n(t),e=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){e.unsubscribe()}:f(r),this._c=r)}catch(n){return void t.error(n)}g(this)&&y(this)};m.prototype=l({},{unsubscribe:function(){b(this)}});var x=function(t){this._s=t};x.prototype=l({},{next:function(t){var n=this._s;if(!g(n)){var r=n._o;try{var e=d(r.next);if(e)return e.call(r,t)}catch(t){try{b(n)}finally{throw t}}}},error:function(t){var n=this._s;if(g(n))throw t;var r=n._o;n._o=void 0;try{var e=d(r.error);if(!e)throw t;t=e.call(r,t)}catch(t){try{y(n)}finally{throw t}}return y(n),t},complete:function(t){var n=this._s;if(!g(n)){var r=n._o;n._o=void 0;try{var e=d(r.complete);t=e?e.call(r,t):void 0}catch(t){try{y(n)}finally{throw t}}return y(n),t}}});var w=function(t){s(this,w,"Observable","_f")._f=f(t)};l(w.prototype,{subscribe:function(t){return new m(t,this._f)},forEach:function(t){var n=this;return new(o.Promise||i.Promise)(function(r,e){f(t);var i=n.subscribe({next:function(n){try{return t(n)}catch(t){e(t),i.unsubscribe()}},error:e,complete:r})})}}),l(w,{from:function(t){var n="function"==typeof this?this:w,r=d(a(t)[c]);if(r){var e=a(r.call(t));return e.constructor===n?e:new n(function(t){return e.subscribe(t)})}return new n(function(n){var r=!1;return u(function(){if(!r){try{if(v(t,!1,function(t){if(n.next(t),r)return p})===p)return}catch(t){if(r)throw t;return void n.error(t)}n.complete()}}),function(){r=!0}})},of:function(){for(var t=0,n=arguments.length,r=Array(n);t<n;)r[t]=arguments[t++];return new("function"==typeof this?this:w)(function(t){var n=!1;return u(function(){if(!n){for(var e=0;e<r.length;++e)if(t.next(r[e]),n)return;t.complete()}}),function(){n=!0}})}}),h(w.prototype,c,function(){return this}),e(e.G,{Observable:w}),r(74)("Observable")},function(t,n,r){var e=r(54),i=r(2),o=e.key,u=e.set;e.exp({defineMetadata:function(t,n,r,e){u(t,n,i(r),o(e))}})},function(t,n,r){var e=r(54),i=r(2),o=e.key,u=e.map,c=e.store;e.exp({deleteMetadata:function(t,n){var r=arguments.length<3?void 0:o(arguments[2]),e=u(i(n),r,!1);if(void 0===e||!e.delete(t))return!1;if(e.size)return!0;var f=c.get(n);return f.delete(r),!!f.size||c.delete(n)}})},function(t,n,r){var e=r(185),i=r(161),o=r(54),u=r(2),c=r(32),f=o.keys,a=o.key,s=function(t,n){var r=f(t,n),o=c(t);if(null===o)return r;var u=s(o,n);return u.length?r.length?i(new e(r.concat(u))):u:r};o.exp({getMetadataKeys:function(t){return s(u(t),arguments.length<2?void 0:a(arguments[1]))}})},function(t,n,r){var e=r(54),i=r(2),o=r(32),u=e.has,c=e.get,f=e.key,a=function(t,n,r){if(u(t,n,r))return c(t,n,r);var e=o(n);return null!==e?a(t,e,r):void 0};e.exp({getMetadata:function(t,n){return a(t,i(n),arguments.length<3?void 0:f(arguments[2]))}})},function(t,n,r){var e=r(54),i=r(2),o=e.keys,u=e.key;e.exp({getOwnMetadataKeys:function(t){
return o(i(t),arguments.length<2?void 0:u(arguments[1]))}})},function(t,n,r){var e=r(54),i=r(2),o=e.get,u=e.key;e.exp({getOwnMetadata:function(t,n){return o(t,i(n),arguments.length<3?void 0:u(arguments[2]))}})},function(t,n,r){var e=r(54),i=r(2),o=r(32),u=e.has,c=e.key,f=function(t,n,r){if(u(t,n,r))return!0;var e=o(n);return null!==e&&f(t,e,r)};e.exp({hasMetadata:function(t,n){return f(t,i(n),arguments.length<3?void 0:c(arguments[2]))}})},function(t,n,r){var e=r(54),i=r(2),o=e.has,u=e.key;e.exp({hasOwnMetadata:function(t,n){return o(t,i(n),arguments.length<3?void 0:u(arguments[2]))}})},function(t,n,r){var e=r(54),i=r(2),o=r(26),u=e.key,c=e.set;e.exp({metadata:function(t,n){return function(r,e){c(t,n,(void 0!==e?i:o)(r),u(e))}}})},function(t,n,r){var e=r(1);e(e.P+e.R,"Set",{toJSON:r(165)("Set")})},function(t,n,r){"use strict";var e=r(1),i=r(147)(!0);e(e.P,"String",{at:function(t){return i(this,t)}})},function(t,n,r){"use strict";var e=r(1),i=r(46),o=r(16),u=r(122),c=r(120),f=RegExp.prototype,a=function(t,n){this._r=t,this._s=n};r(139)(a,"RegExp String",function(){var t=this._r.exec(this._s);return{value:t,done:null===t}}),e(e.P,"String",{matchAll:function(t){if(i(this),!u(t))throw TypeError(t+" is not a regexp!");var n=String(this),r="flags"in f?String(t.flags):c.call(t),e=new RegExp(t.source,~r.indexOf("g")?r:"g"+r);return e.lastIndex=o(t.lastIndex),new a(e,n)}})},function(t,n,r){"use strict";var e=r(1),i=r(181);e(e.P,"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,n,r){"use strict";var e=r(1),i=r(181);e(e.P,"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,n,r){"use strict";r(82)("trimLeft",function(t){return function(){return t(this,1)}},"trimStart")},function(t,n,r){"use strict";r(82)("trimRight",function(t){return function(){return t(this,2)}},"trimEnd")},function(t,n,r){r(153)("asyncIterator")},function(t,n,r){r(153)("observable")},function(t,n,r){var e=r(1);e(e.S,"System",{global:r(3)})},function(t,n,r){for(var e=r(155),i=r(28),o=r(3),u=r(27),c=r(80),f=r(7),a=f("iterator"),s=f("toStringTag"),l=c.Array,h=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],v=0;v<5;v++){var p,d=h[v],y=o[d],g=y&&y.prototype;if(g){g[a]||u(g,a,l),g[s]||u(g,s,d),c[d]=l;for(p in e)g[p]||i(g,p,e[p],!0)}}},function(t,n,r){var e=r(1),i=r(151);e(e.G+e.B,{setImmediate:i.set,clearImmediate:i.clear})},function(t,n,r){var e=r(3),i=r(1),o=r(121),u=r(207),c=e.navigator,f=!!c&&/MSIE .\./.test(c.userAgent),a=function(t){return f?function(n,r){return t(o(u,[].slice.call(arguments,2),"function"==typeof n?n:Function(n)),r)}:t};i(i.G+i.B+i.F*f,{setTimeout:a(e.setTimeout),setInterval:a(e.setInterval)})},function(t,n,r){r(330),r(269),r(271),r(270),r(273),r(275),r(280),r(274),r(272),r(282),r(281),r(277),r(278),r(276),r(268),r(279),r(283),r(284),r(236),r(238),r(237),r(286),r(285),r(256),r(266),r(267),r(257),r(258),r(259),r(260),r(261),r(262),r(263),r(264),r(265),r(239),r(240),r(241),r(242),r(243),r(244),r(245),r(246),r(247),r(248),r(249),r(250),r(251),r(252),r(253),r(254),r(255),r(317),r(322),r(329),r(320),r(312),r(313),r(318),r(323),r(325),r(308),r(309),r(310),r(311),r(314),r(315),r(316),r(319),r(321),r(324),r(326),r(327),r(328),r(231),r(233),r(232),r(235),r(234),r(220),r(218),r(224),r(221),r(227),r(229),r(217),r(223),r(214),r(228),r(212),r(226),r(225),r(219),r(222),r(211),r(213),r(216),r(215),r(230),r(155),r(302),r(307),r(184),r(303),r(304),r(305),r(306),r(287),r(183),r(185),r(186),r(342),r(331),r(332),r(337),r(340),r(341),r(335),r(338),r(336),r(339),r(333),r(334),r(288),r(289),r(290),r(291),r(292),r(295),r(293),r(294),r(296),r(297),r(298),r(299),r(301),r(300),r(343),r(369),r(372),r(371),r(373),r(374),r(370),r(375),r(376),r(354),r(357),r(353),r(351),r(352),r(355),r(356),r(346),r(368),r(377),r(345),r(347),r(349),r(348),r(350),r(359),r(360),r(362),r(361),r(364),r(363),r(365),r(366),r(367),r(344),r(358),r(380),r(379),r(378),t.exports=r(52)},function(t,n){function r(t,n){if("string"==typeof n)return t.insertAdjacentHTML("afterend",n);var r=t.nextSibling;return r?t.parentNode.insertBefore(n,r):t.parentNode.appendChild(n)}t.exports=r},,,,,,,,,function(t,n,r){(function(n,r){!function(n){"use strict";function e(t,n,r,e){var i=n&&n.prototype instanceof o?n:o,u=Object.create(i.prototype),c=new p(e||[]);return u._invoke=s(t,r,c),u}function i(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}function o(){}function u(){}function c(){}function f(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function a(t){function n(r,e,o,u){var c=i(t[r],t,e);if("throw"!==c.type){var f=c.arg,a=f.value;return a&&"object"==typeof a&&m.call(a,"__await")?Promise.resolve(a.__await).then(function(t){n("next",t,o,u)},function(t){n("throw",t,o,u)}):Promise.resolve(a).then(function(t){f.value=t,o(f)},u)}u(c.arg)}function e(t,r){function e(){return new Promise(function(e,i){n(t,r,e,i)})}return o=o?o.then(e,e):e()}"object"==typeof r&&r.domain&&(n=r.domain.bind(n));var o;this._invoke=e}function s(t,n,r){var e=P;return function(o,u){if(e===F)throw new Error("Generator is already running");if(e===M){if("throw"===o)throw u;return y()}for(r.method=o,r.arg=u;;){var c=r.delegate;if(c){var f=l(c,r);if(f){if(f===A)continue;return f}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(e===P)throw e=M,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e=F;var a=i(t,n,r);if("normal"===a.type){if(e=r.done?M:j,a.arg===A)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(e=M,r.method="throw",r.arg=a.arg)}}}function l(t,n){var r=t.iterator[n.method];if(r===g){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=g,l(t,n),"throw"===n.method))return A;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var e=i(r,t.iterator,n.arg);if("throw"===e.type)return n.method="throw",n.arg=e.arg,n.delegate=null,A;var o=e.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=g),n.delegate=null,A):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function h(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function v(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function p(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(h,this),this.reset(!0)}function d(t){if(t){var n=t[w];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,e=function n(){for(;++r<t.length;)if(m.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=g,n.done=!0,n};return e.next=e}}return{next:y}}function y(){return{value:g,done:!0}}var g,b=Object.prototype,m=b.hasOwnProperty,x="function"==typeof Symbol?Symbol:{},w=x.iterator||"@@iterator",S=x.asyncIterator||"@@asyncIterator",_=x.toStringTag||"@@toStringTag",O="object"==typeof t,E=n.regeneratorRuntime;if(E)return void(O&&(t.exports=E));E=n.regeneratorRuntime=O?t.exports:{},E.wrap=e;var P="suspendedStart",j="suspendedYield",F="executing",M="completed",A={},N={};N[w]=function(){return this};var T=Object.getPrototypeOf,I=T&&T(T(d([])));I&&I!==b&&m.call(I,w)&&(N=I);var k=c.prototype=o.prototype=Object.create(N);u.prototype=k.constructor=c,c.constructor=u,c[_]=u.displayName="GeneratorFunction",E.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===u||"GeneratorFunction"===(n.displayName||n.name))},E.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,_ in t||(t[_]="GeneratorFunction")),t.prototype=Object.create(k),t},E.awrap=function(t){return{__await:t}},f(a.prototype),a.prototype[S]=function(){return this},E.AsyncIterator=a,E.async=function(t,n,r,i){var o=new a(e(t,n,r,i));return E.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},f(k),k[_]="Generator",k.toString=function(){return"[object Generator]"},E.keys=function(t){var n=[];for(var r in t)n.push(r);return n.reverse(),function r(){for(;n.length;){var e=n.pop();if(e in t)return r.value=e,r.done=!1,r}return r.done=!0,r}},E.values=d,p.prototype={constructor:p,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(v),!t)for(var n in this)"t"===n.charAt(0)&&m.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],n=t.completion;if("throw"===n.type)throw n.arg;return this.rval},dispatchException:function(t){function n(n,e){return o.type="throw",o.arg=t,r.next=n,e&&(r.method="next",r.arg=g),!!e}if(this.done)throw t;for(var r=this,e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=m.call(i,"catchLoc"),c=m.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&m.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var i=e;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=n,i?(this.method="next",this.next=i.finallyLoc,A):this.complete(o)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),A},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),v(r),A}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var i=e.arg;v(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:d(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=g),A}}}("object"==typeof n?n:"object"==typeof window?window:"object"==typeof self?self:this)}).call(n,function(){return this}(),r(158))}])</script><script src="/./main.266c1c.js"></script><script>!function(){!function(e){var t=document.createElement("script");document.getElementsByTagName("body")[0].appendChild(t),t.setAttribute("src",e)}("/slider.096dc6.js")}()</script>


    
<div class="tools-col" q-class="show:isShow,hide:isShow|isFalse" q-on="click:stop(e)">
  <div class="tools-nav header-menu">
    
    
      
      
      
    
      
    
      
      
      
    
    

    <ul style="width: 70%">
    
    
      
      <li style="width: 50%" q-on="click: openSlider(e, 'innerArchive')"><a href="javascript:void(0)" q-class="active:innerArchive">所有文章</a></li>
      
        
      
        
      
      <li style="width: 50%" q-on="click: openSlider(e, 'aboutme')"><a href="javascript:void(0)" q-class="active:aboutme">关于本站</a></li>
      
        
    </ul>
  </div>
  <div class="tools-wrap">
    
    	<section class="tools-section tools-section-all" q-show="innerArchive">
        <div class="search-wrap">
          <input class="search-ipt" q-model="search" type="text" placeholder="find something…">
          <i class="icon-search icon" q-show="search|isEmptyStr"></i>
          <i class="icon-close icon" q-show="search|isNotEmptyStr" q-on="click:clearChose(e)"></i>
        </div>
        <div class="widget tagcloud search-tag">
          <p class="search-tag-wording">tag:</p>
          <label class="search-switch">
            <input type="checkbox" q-on="click:toggleTag(e)" q-attr="checked:showTags">
          </label>
          <ul class="article-tag-list" q-show="showTags">
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">GitHub</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">工控机</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">Eclipse</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">Git</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">SSH</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">toString</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">java</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">RESTful</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">springMVC</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">jstl</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">javap</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">IDEA</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">CLI</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">Node.js</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">DevTools</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">maven</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">Hibernate</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">PO</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">VO</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">DAO</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">BO</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">POJO</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">DTO</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">English</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">getter-setter</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">lombok</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">gradle</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">nodejs</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">环境变量</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">MongoDB</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">Database</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">摇摇车</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">Linux</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">nvm</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">smart-npm</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">hexo</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">有道</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">linux</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">shadowsocks</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">xfce</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">随机数</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">random</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">kafka</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">mysql</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">Netty</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">redis</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">路由器</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Docker</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">svn</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">sha校验</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">md5校验</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">temp</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">Java</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">位操作</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">字节序</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">bytecode</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">jvm</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Shadowsocks</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Thread</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">Swagger</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">tio</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Voovan</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">ssh</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">heap、stack</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">堆、栈</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">常量池</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">String</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">jQuery</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">cache</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">缓存</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">application.properties</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">SpringBoot</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">BAT</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">批处理</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">CMD</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">logback</a>
              </li>
            
            <div class="clearfix"></div>
          </ul>
        </div>
        <ul class="search-ul">
          <p q-show="jsonFail" style="padding: 20px; font-size: 12px;">
            缺失模块。<br>1、请确保node版本大于6.2<br>2、在博客根目录（注意不是yilia根目录）执行以下命令：<br> npm i hexo-generator-json-content --save<br><br>
            3、在根目录_config.yml里添加配置：
<pre style="font-size: 12px;" q-show="jsonFail">
  jsonContent:
    meta: false
    pages: false
    posts:
      title: true
      date: true
      path: true
      text: false
      raw: false
      content: false
      slug: false
      updated: false
      comments: false
      link: false
      permalink: false
      excerpt: false
      categories: false
      tags: true
</pre>
          </p>
          <li class="search-li" q-repeat="items" q-show="isShow">
            <a q-attr="href:path|urlformat" class="search-title"><i class="icon-quo-left icon"></i><span q-text="title"></span></a>
            <p class="search-time">
              <i class="icon-calendar icon"></i>
              <span q-text="date|dateformat"></span>
            </p>
            <p class="search-tag">
              <i class="icon-price-tags icon"></i>
              <span q-repeat="tags" q-on="click:choseTag(e, name)" q-text="name|tagformat"></span>
            </p>
          </li>
        </ul>
    	</section>
    

    

    
    	<section class="tools-section tools-section-me" q-show="aboutme">
  	  	
  	  		<div class="aboutme-wrap" id="js-aboutme">&lt;p style=&#34;text-align:left;padding-left:50px&#34;&gt;好记性不如烂笔头。&lt;br/&gt;古人诚不我欺也！！&lt;br/&gt;&lt;br/&gt;随着时间的流逝，发现有很多知识点都遗忘了。本博客的诞生，是为了方便日后自己查找一些遗忘的知识点。内容包含：自己写的、网上的摘抄和转载。&lt;/p&gt;</div>
  	  	
    	</section>
    
  </div>
  
</div>
    <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>
  </div>
</body>
</html>